This is a creation in Article, where the information may have evolved or changed.
Ctags (Generate tag files for source code) is a handy code reading tool under Vim. Although Ctags can also support other editors, it officially supports only vim. And Ctags is already installed by default in Vim, which can help programmers navigate through the source code with ease.
Reference:
Http://baike.baidu.com/view/9340968.htm
Environment Preparation:
1, installation Sublimetext 3
Download install latest version Sublimetext 3 HTTP://WWW.SUBLIMETEXT.COM/3
2, install the package Control,
After opening Sublime Text 3, press the shortcut key Ctrl + ' or to the menu bar: View > Show Console to execute the following command
Import urllib.request as urllib2,os;pf= ' package control.sublime-package '; Ipp=sublime.installed_packages_path (); O S.makedirs (IPP) if not os.path.exists (IPP) Else None;urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); Open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' +pf.replace (', '%20 '). Read () )
The following is the Ubuntu
Import Urllib2,os; Pf= ' Package control.sublime-package '; Ipp=sublime.installed_packages_path (); Os.makedirs (IPP) if not os.path.exists (IPP) else None; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); Open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' +pf.replace (', '%20 '). Read () ); print ' Restart Sublime Text to finish installation '
The commands under Mac are as follows:
Import Urllib.request,os; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); Open (Os.path.join (IPP, PF), ' WB '). Write (Urllib.request.urlopen (' http://sublime.wbond.net/' + pf.replace (', '%20 ')) . Read ())
Reference: http://jinzhe.net/post/16.html
3, Installation Gosublime
Command+shift+p Open the Package Control and enter PCIP (the abbreviation for the "Package Control:install package")
In the subsequent interface input gosublime, click on the items that appear, you can successfully install the gosublime.
4. Go FMT Enabled:
Select Perferences>package settings>gosublime>settings User Sublime the Text menu bar
Find the Env and set it to: "env": {"PATH": "$HOME/go/bin: $PATH"}, "Use_gs_gopath": true,
Installing Ctag
4.1. Download and unzip the Ctags.exe in the Ctags package into any directory, then add this directory to the system environment variable path, the simplest is placed in the C:\Windows\System32 directory.
Download Address: http://ctags.sourceforge.net/
Installation method under Mac:
The default ctags executable in OSX does isn't support recursive directory search (i.e. ctags-r). To get a proper copy of Ctags, use one of the following options:
Using Homebrew:
Brew Install Ctags
Using MacPorts:
Port Install Ctags
Ensure the PATH is updated so the correct version is run:
- If which ctags doesn ' t at Ctags in /usr/local/bin, make sure add /usr/local/bin to Yo ur PATH ahead of the folder which Ctags reported.
- Alternatively, add the path to the new ctags executable to the settings, under command. If you had xcode/apple Developer Tools installed this path would likely be /usr/local/bin/ctags.
4.2 Install the sublime text of the Ctags plugin.
Official description Document Address: Https://github.com/SublimeText/CTags
The official Windows installation instructions are as follows:
- Download the CTags binary from the exuberant CTags site.
- Extract Ctags.exe from the downloaded zip to C:\Program files\sublime Text 2 or any folder within your P ATH so that Sublime Text can run it.
- Alternatively, extract to any folder and add the path to this folder to the command setting.
After the installation is complete, after you restart sublime text, open the $GOROOT/pkg
folder,
Where $goroot is the go installation directory, such as the default is C:\go
. After opening, click on the PKG node, right button, select CTags: Rebuild Tags
.
Wait for the completion of the run, we can do jump, on the function by pressing ctrl+shift+ the left mouse button, you can see the jump.
Ctags:rebuild Tags This step is actually under the PKG directory to execute the following command:
Ctags-r-F. Tags command
Sublime Text Import Project
Project->add folder to project, select the file you want to import.
Resources:
http://blog.csdn.net/laukaka/article/details/9737815
Resources:
http://golanghome.com/post/126
The default command shortcut keys for the ctag of Sublime Text are as follows:
See: Https://github.com/SublimeText/CTags
The official shortcut keys are as follows:
But my test under Windows is 2 below and none of the others have been tried:
Invert to Definition: CTRL + SHIFT + Left_click
Jump back: Alt +-(the currently open page of the cursor back)
Reference: http://golanghome.com/post/477
Ubuntu under construction Please refer to: http://golanger.cn/sublime-text-2%E4%BD%BF%E7%94%A8ctags%E5%AE%9E%E7%8E%B0%E5%87%BD%E6%95%B0%E8% b7%b3%e8%bd%ac/