Refactor notes/wiki search functions

This commit is contained in:
Marty Oehme 2019-10-17 18:55:32 +02:00
parent 73b5004c3f
commit 48be54b79c

View file

@ -58,7 +58,7 @@ Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' } " show git status
" Fuzzy matching
Plug 'lotabout/skim.vim'
Plug 'marty-oehme/notational-fzf-vim'
Plug 'marty-oehme/notational-fzf-vim', { 'branch': 'origin/switch-fzf-to-skim' }
Plug 'dyng/ctrlsf.vim'
" Language Integration
@ -535,22 +535,6 @@ let g:skim_action = {
command! -bang -nargs=* Rg call fzf#vim#rg_interactive(<q-args>, fzf#vim#with_preview('right:50%:hidden', 'alt-h'))
" FZF buffers and files in current workdir
noremap <leader>s :Buffers<cr>
" FZF most recently used / MRU, bound to S since it is essentially a larger
" go-back intention than just buffers
noremap <leader>S :History<cr>
noremap <leader>f :Files<cr>
" FZF general full-text search in cwd with rg
noremap <C-F> :Rg<cr>
" FZF note full-text search with notational-velocity like functions
noremap <leader>n :NV<cr>
noremap <leader>N :NV!<cr>
" FZF git diff
noremap <leader>gd :GFiles?<cr>
" Configure notational-fzf-vim
let g:nv_search_paths = [ g:wiki_root ]
let g:nv_wrap_preview_text=1
@ -575,10 +559,25 @@ function! SearchWiki()
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>
vnoremap <C-F> <Plug>CtrlSFVwordPath
nnoremap <leader>wf :execute(":call SearchWiki()")<cr>
" FUZZY FINDING
" FZF buffers and files in current workdir
noremap <leader>s :Buffers<cr>
" FZF most recently used / MRU, bound to S since it is essentially a larger
" go-back intention than just buffers
noremap <leader>S :History<cr>
noremap <leader>f :Files<cr>
" FZF general full-text search in cwd with rg
noremap <C-F> :Rg<cr>
" FZF note full-text search with notational-velocity like functions (in wiki
" directory)
noremap <leader>n :NV<cr>
noremap <leader>N :NV!<cr>
" FZF git diff
noremap <leader>gd :GFiles?<cr>
" insert a citation of a source using bib ref (uses academia library)
nnoremap <leader>c :CiteRef<cr>