From a054b717d2b78cbe0e5df56667ff8d5dd9d859ef Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 21 Nov 2019 14:05:44 +0100 Subject: [PATCH] Move function out of maps.vim to vimrc Does not directly create a mapping and should stay somewhere else than the mapping file. --- .config/nvim/init.vim | 9 +++++++++ .config/nvim/maps.vim | 17 ----------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 9dd45f1..67661f4 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -517,6 +517,15 @@ call matchadd('ColorColumn', '\%81v', 100) " the directories it is supposed to au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile +function! SearchWiki() + let l:curpath=getcwd() + :execute(":cd " . g:wiki_root) + let l:texttofind=input("Search in Notes: ") + :execute(":CtrlSF " . l:texttofind) + :CtrlSFFocus + :execute(":cd " . l:curpath) +endfunction + " }}} " KEYBINDINGS {{{ " ================================================================================ diff --git a/.config/nvim/maps.vim b/.config/nvim/maps.vim index e78aa29..494d190 100644 --- a/.config/nvim/maps.vim +++ b/.config/nvim/maps.vim @@ -152,23 +152,6 @@ let g:nv_fzf_binds = [ \ ] -" Markdown & Pandoc compilation group -" the commented out command can be used if vim-rmarkdown plugin is not -" installed (it is a bit more brittle) -" autocmd FileType rmd noremap :!echo"require(rmarkdown);render('%')"\|R--vanilla -" Compile with rmarkdown -" autocmd FileType markdown,rmarkdown noremap c :RMarkdown pdf -" autocmd FileType markdown,rmarkdown noremap C :RMarkdown! pdf - -function! SearchWiki() - let l:curpath=getcwd() - :execute(":cd " . g:wiki_root) - let l:texttofind=input("Search in Notes: ") - :execute(":CtrlSF " . l:texttofind) - :CtrlSFFocus - :execute(":cd " . l:curpath) -endfunction - " search in wiki with ctrlsf, in fullscreen window nnoremap wf :execute(":call SearchWiki()")