From 5640194504d5e605ce8ba8c88b8265ff90747390 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 23 Jul 2020 12:23:15 +0200 Subject: [PATCH] nvim: Add longer yank highlight, standard toc map Made yank highlight last 0.5s instead of 0.15s. Moved mapping to display toc for markdown and pandoc files to the vim standard mapping of gO (by default only enabled for :Man and :help). Uses :WikiFzfToc, so will only work with wiki.vim --- nvim/.config/nvim/maps.vim | 11 +++++++++-- nvim/.config/nvim/plugin/personal/highlightyank.vim | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nvim/.config/nvim/maps.vim b/nvim/.config/nvim/maps.vim index 73edac6..1cc7ccb 100644 --- a/nvim/.config/nvim/maps.vim +++ b/nvim/.config/nvim/maps.vim @@ -194,7 +194,11 @@ nnoremap wF :execute(":call SearchNotes()") " localleader is used when it is specific to the local file nnoremap wf :WikiFzfPages nnoremap l :WikiFzfTags -nnoremap l :WikiFzfToc +" use default TOC shortcut for viewing wikitoc if in correct filetype +augroup wikitoc + autocmd! + autocmd Filetype markdown,pandoc nnoremap gO :WikiFzfToc +augroup END " overwrites some default mappings I don't use, or that interfere with my own " mappings TODO: currently this just assigns bogus shortcuts, since the plugin grumbles @@ -210,7 +214,10 @@ let g:wiki_mappings_local = { \ '(wiki-graph-out)' : 'wG', \} " additional zettelkasten mapping -au Filetype markdown,pandoc nnoremap :ZettelOpenAtCursor +augroup zettelkasten + autocmd! + autocmd Filetype markdown,pandoc nnoremap :ZettelOpenAtCursor +augroup END " Mostly dealing with Prose writing from here on out " Format current Paragraph (esp useful in prose writing) diff --git a/nvim/.config/nvim/plugin/personal/highlightyank.vim b/nvim/.config/nvim/plugin/personal/highlightyank.vim index f219879..f934dc9 100644 --- a/nvim/.config/nvim/plugin/personal/highlightyank.vim +++ b/nvim/.config/nvim/plugin/personal/highlightyank.vim @@ -1,5 +1,5 @@ " will highlight any text which has been yanked -augroup LuaHighlight +augroup LuaHighlightYank autocmd! - autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank() + autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank{timeout=500} augroup END