Add quick fuzzy note search to wiki

Use <leader>wf from anywhere to fuzzysearch a phrase over the notes. If
no initial input is given loads all files into the interactive
fuzzysearch. Use <leader>wF to load a more detailed, full-screen windows
(via CtrlSF) which allows direct editing of results and more.
This commit is contained in:
Marty Oehme 2019-06-12 14:24:38 +02:00
parent f06ab7804e
commit 6557b8dce0

View file

@ -372,9 +372,23 @@ function! SearchWiki()
:execute(":cd " . l:curpath)
endfunction
" search in wiki with ctrlsf
nnoremap <leader>wf :execute(":call SearchWiki()")<cr>
nnoremap <C-F> <Plug>CtrlSFPrompt
function! RgWiki()
let l:curpath=getcwd()
:execute(":cd " . g:wiki_root)
let l:texttofind=input("Search Notes: ")
if l:texttofind ==? ""
:execute(":Leaderf rg")
else
:execute(":Leaderf rg -e " . l:texttofind )
endif
:execute(":cd " . l:curpath)
endfunction
" search in wiki with ctrlsf, in fullscreen window
nnoremap <leader>wF :execute(":call SearchWiki()")<cr>
" fuzzy search wiki with leaderf
nnoremap <leader>wf :execute(":call RgWiki()")<cr>
nnoremap <C-F> :execute(":Leaderf rg -e *")<cr>
vnoremap <C-F> <Plug>CtrlSFVwordPath
" Mostly dealing with Prose writing from here on out