This is a creation in Article, where the information may have evolved or changed.
Ctags Introduction
Ctags can index the source file structure of the programming language and achieve quick jumps, including objects, variables, methods, and so on.
Install ctags under Windows
Download the installation package
Unzip the installation package and ctags.exe
copy the files to the C:/Windows/System32
directory
Execute command under CMD to ctags --version
verify the installation is successful
Sublime Text Installation Ctags Plugin
In window selection Preferences
, Package Control
Install Package
Enter the search to install plugin in the input box ctags
, select Plug-in to install
Modify the configuration, in window selection, Preferences
Package Settings
Ctags
Settings-Default
Copy all of the content in the Settings->User
Settings-User
variables in the modificationcommand
"command": "C:/Windows/System32/ctags.exe"
Restart Sublime Text
Use
Right-click on the project directory of sublime text to select CTags:Rebuild Tags
Build index
Right click to select Navigate to Definition
or Jump Back
jump, you can also use shortcut keys (need to modify the configuration Key Bindings-User
)
Support Golang
Because the ctags5.8 version does not support the Golang language by default (you can view the supported language types by command ctags--list-kinds
under cmd), you need to add a configuration file . Ctags
for extended support.
--langdef=go--langmap=go: . Go--regex-go=/func ([\t]+\ ([^)]+\))? [\t]+ ([a-za-z0->9_]+)/\2/f,func/--regex-go=/var[\t]+ ([a-za-z_][a-za-z0-9_]+]/\1/v,var/--regex-go=/type[\t]+ ([a-za-z_][a-za-z0-9_]+)/\1/t,type/
... Go f func v var t type