diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index cebfcf9..69197d1 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -55,7 +55,10 @@ Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detect " " Plug 'tpope/vim-fugitive' - Will have to take a closer look some other time Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " show a directory listing within vim Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' } " show git status in nerdtree for files and dirs -Plug 'Yggdroot/LeaderF', { 'on': ['Leaderf', 'LeaderfFile', 'LeaderfBuffer'], 'do': './install.sh' } " fuzzy matcher, apparently faster than fzf, ctrlp, unit, denite + +" Fuzzy matching +Plug 'lotabout/skim.vim' +Plug 'marty-oehme/notational-fzf-vim' Plug 'dyng/ctrlsf.vim' " Language Integration @@ -445,9 +448,41 @@ au FileType go nnoremap :GoCoverageToggle -short " go to the definition of whatever you hover over au FileType go nnoremap (go-def) -" Call leaderf with (necessary to enable leaderf lazyloading) -nnoremap F :LeaderfFile -nnoremap f :LeaderfBuffer +" skim.vim (fzf alternative) fuzzy finding configuration +" extra key bindings in skim window +let g:skim_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-h': 'split', + \ 'ctrl-v': 'vsplit' } + +command! -bang -nargs=* Rg call fzf#vim#rg_interactive(, fzf#vim#with_preview('right:50%:hidden', 'alt-h')) + +" FZF buffers and files in current workdir +noremap s :Buffers +" FZF most recently used / MRU, bound to S since it is essentially a larger +" go-back intention than just buffers +noremap S :History +noremap f :Files + +" FZF general full-text search in cwd with rg +noremap :Rg +" FZF note full-text search with notational-velocity like functions +noremap n :NV +noremap N :NV! + +" Configure notational-fzf-vim +let g:nv_search_paths = [ '~/Nextcloud/Notes/' ] +let g:nv_wrap_preview_text=1 +" Dictionary with string keys and values. Must be in the form 'ctrl-KEY': +" 'command' or 'alt-KEY' : 'command'. See examples below. +let g:nv_fzf_binds = [ + \ 'alt-a:select-all', + \ 'alt-q:deselect-all', + \ 'alt-p:toggle-preview', + \ 'alt-u:page-up', + \ 'alt-d:page-down', + \ 'ctrl-w:backward-kill-word', + \ ] function! SearchWiki() let l:curpath=getcwd() @@ -458,24 +493,10 @@ function! SearchWiki() :execute(":cd " . l:curpath) endfunction -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 wF :execute(":call SearchWiki()") " fuzzy search wiki with leaderf nnoremap wf :execute(":call RgWiki()") -" fuzzy search current working dir -nnoremap :execute(":Leaderf rg") vnoremap CtrlSFVwordPath " Mostly dealing with Prose writing from here on out