stdcerr
stdcerr

Reputation: 15608

use word under cursor in cscope search

Is there a way to use the word under the cursor in a cscope search in Vim? If the cursor is over a variable Foo and I want to avoid needing to type Foo again in the command line but would like to assemble :cs f s Foo.

Is there any way I can automate it?

Upvotes: 2

Views: 626

Answers (1)

phd
phd

Reputation: 94511

Use CTRL-R CTRL-W to copy the word under cursor to the command line:

:cs f s <C-R><C-W>

See the documentation for more information.

Upvotes: 7

Related Questions