5

I just installed cscope-15.8b, then go to linux-next folder, run "cscope -R", after build the tags, then open a file through "Find this file" // so far so good.

Now if I want to go to a symbol's defination, by ctrl + ], it will throw error: "E433: No tags file" "E426: tag not found".

If I open the cscope.out file, I will see it looks like broken (see below). How do Ifix this?

1 ^B ~<¡dio.h >

2 ^B ~<¡dlib.h >

3 ^B ~

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Howard Shane
  • 926
  • 13
  • 28

2 Answers2

6

The fact that the cscope.out file looks "broken" is normal, the file format is sort-of text but includes some non-printing characters as well.

Your problem is that ctrl + ] doesn't search cscope databases by default, it only searches ctags files which are entirely different. You need to set cscopetag in your .vimrc file to make it search both. From the vim help:

If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t" will always use :cstag instead of the default :tag behavior. Effectively, by setting 'cst', you will always search your cscope databases as well as your tag files. The default is off.

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Evan
  • 6,369
  • 1
  • 29
  • 30
  • That means either you've selected a symbol not in the cscope database, or vim is not picking up the correct symbol. Either way, it is at least *looking* in the cscope database now – Evan Aug 18 '15 at 20:05
2

Add these lines to your ~/.vimrc file:

set cscopetag
set csto=0
set tags=./tags,tags;/
cs add cscope.out

Better yet, copy this entire file into the ~/.vimrc file: http://cscope.sourceforge.net/cscope_maps.vim

roolebo
  • 819
  • 9
  • 15