diff --git a/init.lua b/init.lua index 3325d65d..c09a81ec 100644 --- a/init.lua +++ b/init.lua @@ -132,7 +132,7 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', @@ -156,7 +156,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -174,16 +174,16 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() + vim.keymap.set({'n', 'v'}, ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' - end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) - vim.keymap.set({ 'n', 'v' }, '[c', function() + end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) + vim.keymap.set({'n', 'v'}, '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' - end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) + end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) end, }, }, @@ -362,12 +362,10 @@ vim.keymap.set({ 'n', 'v' }, 'a;', ":Tab /;", { silent = true }) vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - - --- [[ highlight on yank ]] --- see `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup('yankhighlight', { clear = true }) -vim.api.nvim_create_autocmd('textyankpost', { +-- [[ Highlight on yank ]] +-- See `:help vim.highlight.on_yank()` +local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) +vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.highlight.on_yank() end,