Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cscope shows error after using vim keyboard maps

Tags:

vim

cscope

I used the keyboard mappings from http://cscope.sourceforge.net/cscope_maps.vim to have keyboard shortcuts in cscope. My maps are

 nmap <C-s> :cs find s <C-R>=expand("<cword>")<CR><CR>    
 nmap <C-g> :cs find g <C-R>=expand("<cword>")<CR><CR>
 nmap <C-c> :cs find c <C-R>=expand("<cword>")<CR><CR>
 nmap <C-x> :cs find t <C-R>=expand("<cword>")<CR><CR>
 nmap <C-e> :cs find e <C-R>=expand("<cword>")<CR><CR>
 nmap <C-f> :cs find f <C-R>=expand("<cfile>")<CR><CR>
 nmap <C-i> :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
 nmap <C-d> :cs find d <C-R>=expand("<cword>")<CR><CR>

When I press Ctrl-g with the cursor on a symbol, it goes to the proper definition but shows this error. E259 : no matches found for cscope query

I have figured out the answer, just posting it so that someone else will not waste as much time as I did.

like image 334
saketrp Avatar asked Aug 12 '26 03:08

saketrp


1 Answers

You need to check if there are any extra tabs after the nmap. Removing any extra tabs solved my problem. The cscope_maps.vim file on the sourceforge site has them. Also do make sure that the '=' symbol is not flanked on either side by a space, that too can lead to this type of an error.

like image 197
saketrp Avatar answered Aug 15 '26 08:08

saketrp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!