This is a creation in Article, where the information may have evolved or changed.
About the introduction of Ctags, here is not introduced, we can search to understand the next. (Ubuntu under test, other environments not tested)
1. Install the ctags as follows:
Curl-o http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
Tar xzvf ctags-5.8.tar.gz
CD ctags-5.8
./configure
Make
sudo make install
2. Add the ~/.ctags file with the following content:
–langdef=go
–langmap=go:.go
–regex-go=/func ([t]+ ([^)]+))? [T]+ ([a-za-z0-9_]+)/2/d,func/
–regex-go=/var[t]+ ([a-za-z_][a-za-z0-9_]+)/1/d,var/
–regex-go=/type[t]+ ([a-za-z_][a-za-z0-9_]+)/1/d,type/
3. Install the sublime Text 2 ctags plugin:
Address: Https://github.com/SublimeText/CTags
4. Create a. tags file in your project directory:
yourihua@ubuntu:~/workplace/rhino$ ctags-r-F. tags
yourihua@ubuntu:~/workplace/rhino$
You can also use ctrl+shift+p rebuild a bit of tags.
Well, now you can try, here are the common commands:
Commands Listing
| Command |
Key Binding |
Alt Binding |
Mouse Binding |
| Rebuild_ctags |
Ctrl+t Ctrl+r |
|
|
| Navigate_to_definition |
Ctrl+t ctrl+t |
Ctrl+> |
Ctrl+shift+left_click |
| Jump_back |
Ctrl+t ctrl+b |
ctrl+< |
Ctrl+shift+right_click |
| Jump_back to_last_modification |
Ctrl+t ctrl+m |
|
|
| Show_symbols |
Alt+s |
|
|
| Show_symbols Multi |
Alt+shift+s |
|
|
| Show_symbols suffix |
Ctrl+alt+shift+s |
|
|
Reference article:
Http://www.gravitywell.co.uk/blog/post/how-to-set-up-ctags-for-sublime-text-editor-2
Http://go-wise.blogspot.com/2011/09/using-ctags-with-go.html
Max Os needs attention:
Http://gmarik.info/blog/2010/10/08/ctags-on-OSX
2013-07-14
Add:
Add Setting–user configuration, convenient Sublime text 2 right-click Rebuild Tags. As follows:
{
"Command": "/usr/local/bin/ctags-r-F tags"
}