LoginSignup
1
1

More than 5 years have passed since last update.

gtags.vimのGtagsCursorで、1件しか関数定義がないなら、quickfix-windowを開かないようにする

Last updated at Posted at 2015-11-08

まずは、globalと、gtags.vimとをインストールする。

$ yaourt -S global vim # 試していないが、UbuntuなどのDebian系なら、sudo apt-get install vim globalでうまく行くはず。
$ midir -p ~/.vim/plugin
$ cp /usr/share/gtags/gtags.vim ~/.vim/plugin

そして、~/.vimrcに以下のように書く。

~/.vimrc
function! GtagsCursor_()
  execute "GtagsCursor"

  if (len(getqflist()) <= 1)
    cclose
  endif
endfunction
nnoremap <C-j> :call GtagsCursor_()<CR>

もちろん、<C-j>以外のキーに割り当ててもよい。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1