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.
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
- Browsing programs with tags
- Vim and Ctags
- Installing and using ctags & cscope
- Using gvim properly...(ctag+cscope+taglist+find+gvim)
- Analyzing the Kernel with ctags + cscopes + taglist
- On code navigation with CTags
- Developer vim basics + tips + plugins (tag list, ctags, autocompletion)
- Using ctags and vi
- Setting tags when working with multiple source branches
- Joinc: Source code analysis with ctags
Tips and tricks
- Stackoverflow: Get ctags in vim to go to definition, not declaration
- Stackoverflow: Vim and Ctags tips and tricks (closed)
Pages that link here