Set fzf commands to actually use FZF

This commit is contained in:
Marty Oehme 2019-11-04 21:59:43 +01:00
parent 570c575776
commit 75195765ca

View file

@ -53,6 +53,7 @@ Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' } " show git status
" Fuzzy matching
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'marty-oehme/notational-fzf-vim', { 'branch': 'origin/switch-fzf-to-skim' }
Plug 'dyng/ctrlsf.vim'
@ -272,6 +273,7 @@ autocmd! User GoyoLeave nested call <SID>goyo_leave()
" FZF Fuzzy Finding
" set some fzf defaults
let g:fzf_layout = { 'up': '~40%' }
let g:fzf_command_prefix = 'Fzf'
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
@ -338,7 +340,6 @@ command! -bang -nargs=* CiteMarkdown call fzf#run(fzf#wrap({
\ 'up': '25%',
\ 'options': '--ansi --multi --prompt "Markdown> "'
\ }))
" map @@ to automatically insert citation reference at cursor
inoremap <silent> @@ <c-g>u<c-o>:call fzf#run(fzf#wrap({
\ 'source': <sid>bibtex_ls(),
@ -611,15 +612,6 @@ au FileType go nnoremap <F9> :GoCoverageToggle -short<cr>
" go to the definition of whatever you hover over
au FileType go nnoremap <F12> <Plug>(go-def)
" 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(<q-args>, fzf#vim#with_preview('right:50%:hidden', 'alt-h'))
" Configure notational-fzf-vim
let g:nv_search_paths = [ g:wiki_root ]
let g:nv_wrap_preview_text=1
@ -657,21 +649,21 @@ nnoremap <leader>wf :execute(":call SearchWiki()")<cr>
" FUZZY FINDING
" FZF buffers and files in current workdir
noremap <leader>s :Buffers<cr>
noremap <leader>s :FzfBuffers<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>
noremap <leader>S :FzfHistory<cr>
noremap <leader>f :FzfFiles<cr>
" FZF general full-text search in cwd with rg
noremap <C-F> :Rg<cr>
noremap <C-F> :FzfRg<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>
noremap <leader>gd :FzfGFiles?<cr>
" insert a citation of a source using bib ref (uses academia library)
nnoremap <leader>c :CiteRef<cr>