Skip to content
Search

Vim:Plugin:Ctags

lastmod 2018-08-17created 2015-02-1216 edits

Uses ctags in vim to help jump between symbols.

Warning

Warning

Conflicts with SrcExpl. Take care if you use that plugin.

How to use

First, generate tags using Ctags.

$ ctags -R .

Then add the generated TAG list to your vimrc as below.

set tags=./tags,tags
"" OR
set tags=./tags,tags
set tags+=../tags
set tags+=../../tags
...
set tags+=../../../../../../tags
set tags+=(특정 SDK의 tags 경로)

For details, check :help tags-option.

Command

Ctrl-]
Search for the symbol and jump to it.
Ctrl-t
Return to the file before the jump.
:tselect [function-name]
When there are multiple matches for the same function-name, shows a list. You can select one by number.
:tnext
When multiple function names exist, selects the next function.
:tprevious
Selects the previous function.
:tfirst
Selects the first function found.
:tlast
Selects the last function.

Troubleshooting

Blank screen

When jumping to a symbol (TAG) with Ctrl-], a black screen may appear. In that case, check whether the SrcExpl plugin is installed and remove it. (It conflicts with that plugin.)

See also

Favorite site

Tips and tricks