Hot answers tagged

9

To close the quickfix window, you use :cclose, as @statox mentioned in the comments. This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you ...


3

The :execute command will assemble an Ex command from strings and evaluate it. Here, in this case, it's actually breaking your command, since it's expanding the g:projectRoot string and forming a string that is an invalid Ex command, since the quotes around the path are now missing. That command is actually equivalent to: let ProRoot=/mnt/hgfs/projects/...


3

Ensure setting the cscope using the following in your ~/.vimrc file: set cscopetag set cst set csto=0 set tags=./tags,tags;/ cs add cscope.out Once it is done, re-login into the terminal to run cscope. Jump to a tag: Ctrl] Jump back: CtrlO Jump to a tag again: CtrlI


2

I use a shell function to perform git checkout. (I call it gco.) This function performs some index updating, if the checkout succeeds. (In my case I am interested in updating my cindex, while you want to update your cscope.) gco() { git checkout "$@" local ret_status="$?" if [ "$ret_status" = 0 ] && [ -n "$POST_GIT_CHECKOUT" ] ...


2

GNU Global's distribution already has a couple of vim scripts that are pretty handy. Look for 'gtags.vim' and 'gtags-cscope.vim' (the most adequate probably for what you want) in Global's installation directory, and just copy the one you prefer to your 'plugins' dir inside vim's config. The second script will do a set csprg=gtags-cscope for you, which ...


1

With cscopetag enabled, you get E257 on tags not being found (credits Mass in the comments). Fortunately, the help for this error contains useful information: use :cstag! It can do searches in both; precedence is controlled by 'cscopetagorder'. Of course, the error and description of cscopetag make it sound like the tag wasn't found after searching both, so ...


1

Invoke vim as view on the command line: view myfile.c This will automatically set the appropriate “readonly” flags.


1

It seems, that the following works: :cs find e status[ ]=


1

In the source code directory use the following command: find . -name '*.cpp' -o -name '*.h' > gtags.files gtags --accept-dotfiles -c -f gtags.files This will build the cross reference. In vim, you can issue the following command to invoke gtags-cscope :GtagsCscope


Only top voted, non community-wiki answers of a minimum length are eligible