From 3884d28dbd89592ea4d131fba6f630be10199f59 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 10 Jul 2020 10:10:34 +0200 Subject: [PATCH] [nvim] Add yank highlight and substitution preview Added quick highlighting of whatever text is added to a yank buffer. Added live preview of `:%s/sub/command/` in current buffer and preview window. --- nvim/.config/nvim/init.vim | 3 +++ nvim/.config/nvim/plugin/personal/highlightyank.vim | 5 +++++ nvim/.config/nvim/spell/en.utf-8.add | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 nvim/.config/nvim/plugin/personal/highlightyank.vim diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 9b57cc5..d34b27c 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -138,6 +138,9 @@ set undofile set ignorecase set smartcase +" shows previews of what substitute command will do (and a couple others) +set inccommand=split + " whenever vim loses focus, save au FocusLost * :wa diff --git a/nvim/.config/nvim/plugin/personal/highlightyank.vim b/nvim/.config/nvim/plugin/personal/highlightyank.vim new file mode 100644 index 0000000..f219879 --- /dev/null +++ b/nvim/.config/nvim/plugin/personal/highlightyank.vim @@ -0,0 +1,5 @@ +" will highlight any text which has been yanked +augroup LuaHighlight + autocmd! + autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank() +augroup END diff --git a/nvim/.config/nvim/spell/en.utf-8.add b/nvim/.config/nvim/spell/en.utf-8.add index e21e8f5..4981a6f 100644 --- a/nvim/.config/nvim/spell/en.utf-8.add +++ b/nvim/.config/nvim/spell/en.utf-8.add @@ -38,3 +38,5 @@ plugin Solidarność transnationalism heroization +technologization +Kyūshū