When using ctags, one can move back through the tag stack by using [count]CTRL-T or :[count]pop, and forward using :[count]tag

However, when using cscope instead of ctags and setting 'cscopetag', only the backwards direction works (that is, :[count]pop works, but :[count]tag gives E433: No tags file and E426: tag not found with the name of the tag at that point in the tagstack).

Is there a way to enable the forward direction when using cscope?

  • 1
    I haven't used cscope (didn't even know it existed!), but the documentation makes it sound like this is supposed to just work. Have you got csto set to zero? (the default)
    – Rich
    Commented Feb 8, 2015 at 10:39
  • I do: set csto? shows cscopetagorder=0
    – John O'M.
    Commented Feb 8, 2015 at 14:21

2 Answers 2


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
    Welcome to Vi stack exchange! ctrl+o and ctrl+i walk the jump list. This works great so long as one doesn't jump around between tag switches, which is often the case when just walking through a couple function calls, so have an upvote. Unfortunately for me, I sometimes move around a lot at a given call level which breaks this, or bounce between different tags which can get the jump list out-of-sync with my tag stack.
    – John O'M.
    Commented Sep 12, 2017 at 3:36

Other than generate the cscope.out, you need to run ctags -L cscope.files to generate the tags file. With both of that you can move back and force in the cscope tagstack

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.