]> git.armaanb.net Git - dotfiles.git/commitdiff
nvim: highlight on yank, use nvim_utils plugin
authorArmaan Bhojwani <me@armaanb.net>
Tue, 23 Nov 2021 04:01:15 +0000 (23:01 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Tue, 23 Nov 2021 04:01:43 +0000 (23:01 -0500)
.config/nvim/init.lua

index 9708fa86a34db74c14c8382fc95c24237c27a888..26bb3d7275d3e8d79c746af305ce77e275544a0d 100644 (file)
@@ -31,6 +31,7 @@ require('paq') {
        'nathom/filetype.nvim';           -- Faster filetype.vim replacement
        'neovim/nvim-lspconfig';          -- LSP configurations
        'norcalli/nvim-colorizer.lua';    -- Highlight css colors
+       'norcalli/nvim_utils';            -- Lua conveniences
        'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
        'nvim-treesitter/nvim-treesitter';-- Parsing
        'romgrk/nvim-treesitter-context'; -- Shows context for where you are
@@ -42,6 +43,8 @@ require('paq') {
        'tpope/vim-surround';             -- Easily modify surrounding chars
 }
 
+require('nvim_utils')
+
 -- Colorscheme
 vim.opt.termguicolors = true
 vim.g.colors_name = 'hima'
@@ -145,3 +148,13 @@ vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
 vim.opt.foldenable = false
 map('n', '<leader>fe', ':set foldenable<CR>', opts)
 map('n', '<leader>fd', ':set nofoldenable<CR>', opts)
+
+-- Autocommands
+local autocommands = {
+       highlight_yank = {
+               {'TextYankPost', '*',
+                       'lua vim.highlight.on_yank{on_visual=false}'};
+       };
+}
+
+nvim_create_augroups(autocommands)