diff --git a/nvim/.config/nvim/after/ftplugin/qf.vim b/nvim/.config/nvim/after/ftplugin/qf.vim index 07ce1cf..1b6ceb6 100644 --- a/nvim/.config/nvim/after/ftplugin/qf.vim +++ b/nvim/.config/nvim/after/ftplugin/qf.vim @@ -15,30 +15,3 @@ setlocal nospell nnoremap [- :colder nnoremap ]+ :cnewer nnoremap g :Cfilter - -nnoremap o p -nnoremap p :call preview_file() - -let b:qf_isLoc = ! empty(getloclist(0)) -if b:qf_isLoc == 1 - nnoremap q :lclose -else - nnoremap q :cclose -endif - -" Taken from https://github.com/voldikss/dotfiles -function! s:preview_file() - let winwidth = &columns - let cur_list = b:qf_isLoc == 1 ? getloclist('.') : getqflist() - let cur_line = getline(line('.')) - let cur_file = fnameescape(substitute(cur_line, '|.*$', '', '')) - if cur_line =~# '|\d\+' - let cur_pos = substitute(cur_line, '^\(.\{-}|\)\(\d\+\)\(.*\)', '\2', '') - execute 'vertical pedit +'.cur_pos.' '.cur_file - else - execute 'vertical pedit '.cur_file - endif - wincmd P - execute 'vert resize '.(winwidth / 2) - wincmd p -endfunction diff --git a/nvim/.config/nvim/after/plugin/fzf-preview.vim b/nvim/.config/nvim/after/plugin/fzf-preview.vim new file mode 100644 index 0000000..6daddbf --- /dev/null +++ b/nvim/.config/nvim/after/plugin/fzf-preview.vim @@ -0,0 +1,9 @@ +nnoremap fg :FZFGGrep +nnoremap fG :FZFGrep +nnoremap fl :FZFBLines +nnoremap f\ :FZFRg +nnoremap fS :exe ':FZFRg ' . expand('') +nnoremap ft :exe ':FZFTags ' . expand('') +nnoremap fT :FZFTags +nnoremap fq :cclose:FZFQuickFix +nnoremap fQ :lclose:FZFLocList diff --git a/nvim/.config/nvim/after/plugin/fzf.vim b/nvim/.config/nvim/after/plugin/fzf.vim index 7d71db7..f746b68 100644 --- a/nvim/.config/nvim/after/plugin/fzf.vim +++ b/nvim/.config/nvim/after/plugin/fzf.vim @@ -4,9 +4,6 @@ nnoremap / :GFiles? nnoremap ff :GFiles nnoremap fF :Files nnoremap fL :Lines -nnoremap fl :BLines -nnoremap ft :exe ':Tags ' . expand('') -nnoremap fT :Tags nnoremap fc :BCommits nnoremap fC :Commits nnoremap fh :History: diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index c5824a5..f7f416c 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -36,6 +36,7 @@ Plug 'hauleth/asyncdo.vim' Plug 'ronakg/quickr-cscope.vim' Plug 'milkypostman/vim-togglelist' Plug 'yssl/QFEnter' +Plug 'chengzeyi/fzf-preview.vim' " Text Object plugins Plug 'wellle/targets.vim' Plug 'tpope/vim-surround'