diff --git a/vimrc b/vimrc index 26d9d47aa9be5bd3d7b1a4f241a93615d53800b7..e980e8ae9430ec28551d4e6e0049c8f0f08a7f9f 100644 --- a/vimrc +++ b/vimrc @@ -14,7 +14,6 @@ nnoremap :bnext nnoremap :bprevious nnoremap :buffers:buffer -nnoremap :Explore nnoremap :copen " Personal tabs/spaces settings. @@ -42,3 +41,12 @@ if &filetype == 'go' | write | call system('go fmt '.expand('%')) | edit! | endif endfunction command! Format call Format() +" FZF integration. +function! FZF() + let t=tempname() + silent execute '!fzf --preview=''cat {}'' --multi|awk ''{print $1":1:0"}'' > '.fnameescape(t) + execute 'cfile '.t|redraw! + call delete(t) +endfunction +nnoremap :call FZF() +