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:
parent
f06ab7804e
commit
6557b8dce0
1 changed files with 17 additions and 3 deletions
|
@ -372,9 +372,23 @@ function! SearchWiki()
|
||||||
:execute(":cd " . l:curpath)
|
:execute(":cd " . l:curpath)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" search in wiki with ctrlsf
|
function! RgWiki()
|
||||||
nnoremap <leader>wf :execute(":call SearchWiki()")<cr>
|
let l:curpath=getcwd()
|
||||||
nnoremap <C-F> <Plug>CtrlSFPrompt
|
: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
|
vnoremap <C-F> <Plug>CtrlSFVwordPath
|
||||||
|
|
||||||
" Mostly dealing with Prose writing from here on out
|
" Mostly dealing with Prose writing from here on out
|
||||||
|
|
Loading…
Reference in a new issue