From ec64c3237a55fc83f68a0685bcdab1a74dd4ddb7 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sat, 19 Sep 2020 16:34:20 +0800 Subject: [PATCH] use internal yank highlight instead of plugins --- autocommands.vim | 6 ++++++ plugins.vim | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/autocommands.vim b/autocommands.vim index f46a06c..1a40a0f 100644 --- a/autocommands.vim +++ b/autocommands.vim @@ -56,4 +56,10 @@ augroup numbertoggle autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif augroup END + +" highlight yanked region, see `:h lua-highlight` +augroup highlight_yank + autocmd! + au TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=700} +augroup END "} diff --git a/plugins.vim b/plugins.vim index fe548a1..a330303 100644 --- a/plugins.vim +++ b/plugins.vim @@ -283,9 +283,6 @@ Plug 'mattn/emmet-vim' "}} "{{ Misc plugins -" Highlight yanked region -Plug 'machakann/vim-highlightedyank' - " Modern matchit implementation Plug 'andymass/vim-matchup' @@ -813,13 +810,6 @@ let g:airline_highlighting_cache = 1 "}} "{{ Misc plugin setting -""""""""""""""""""" vim-highlightedyank settings """""""""""""" -" Reverse the highlight color for yanked text for better visuals -highlight HighlightedyankRegion cterm=reverse gui=reverse - -" Let highlight endures longer -let g:highlightedyank_highlight_duration = 1000 - """"""""""""""""""""""""""""vim-matchup settings""""""""""""""""""""""""""""" " Improve performance let g:matchup_matchparen_deferred = 1