DragonX
DragonX

Reputation: 381

unable to use cscope multi key stroke via vim editor

I am using VIM 7.0 on RHEL release 5.4, and downloaded cscope plugin from: http://cscope.sourceforge.net/cscope_maps.vim

and copied it to path(one instance at a time): ~/.vim/plugin/cscope_maps.vim & /usr/share/vim/vim70/autoload

and generated cscope -qbR from root dir of source files, & opening *.C files from same dir.

According to this(point 5) & cscope_maps.vim, I should be able to do keyword search by multiple keystroke: CTRL-\ <option> or CTRL-@ <option> by placing the cursor under the keyword as we do for ctags. But I am able to access the cscope keyword search only through the vim's command line argument (ie., :cs f d or :cs f c) and not with multiple key stroke shortcut.

I've also tried pasting all the contents of cscope_maps.vim to ~/.vimrc, but it didn't help

Is there something I am doing wrong/ any other way to make it work?

Upvotes: 2

Views: 1890

Answers (4)

Hardik Prajapati
Hardik Prajapati

Reputation: 11

Probably your code base is other then .c files. I was facing same issue as my code base includes c and c++ both. I was trying with c++ functions and was facing same issue you mentioned. Hint- Build cscope data base with all required files.

Upvotes: 1

Lord_Rafa
Lord_Rafa

Reputation: 23

I had the same problem with cscope and Vim 7.4. I could solve it in Arch uncommenting in cscope_maps.vim the bellow lines:

set timeoutlen=4000
set ttimeout

BTW I followed this tutorial to install cscope vim plugin on Arch: https://wiki.archlinux.org/index.php/vim#cscope

Upvotes: 0

Ingo Karkat
Ingo Karkat

Reputation: 172530

As described in the plugin's documentation, copy the plugin to

~/.vim/plugin/cscope_maps.vim

The autoload directory you've chosen is wrong, this is for plugins' on-demand functionality.

Also, /usr/share/vim/vim70/ is owned by the default Vim package, don't touch anything there (in general), or you'll run into problems when reinstalling / upgrading packages! If you do need to have a system-wide plugin, check :help runtimepath and find / add a proper location that you own on the system.

Upvotes: 1

Ani
Ani

Reputation: 1526

Probably, you are missing the CSCOPE_DB environment variable - i.e, it should point to the valid cscope.out file

To check, once you are in vim, run :echo $CSCOPE_DB, mine shows: /home/me/views/myrepo/cscope.out

Upvotes: 0

Related Questions