Windows Sublime Text installation Ctags plugin support Golang

Source: Internet
Author: User
Tags sublime text
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

  1. Download the installation package

  2. Unzip the installation package and ctags.exe copy the files to the C:/Windows/System32 directory

  3. Execute command under CMD to ctags --version verify the installation is successful

Sublime Text Installation Ctags Plugin

  1. In window selection Preferences , Package ControlInstall Package

  2. Enter the search to install plugin in the input box ctags , select Plug-in to install

  3. Modify the configuration, in window selection, Preferences Package SettingsCtags

  4. Settings-DefaultCopy all of the content in the Settings->User

  5. Settings-Uservariables in the modificationcommand
    "command": "C:/Windows/System32/ctags.exe"

  6. Restart Sublime Text

Use

  1. Right-click on the project directory of sublime text to select CTags:Rebuild Tags Build index

  2. 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.

  • Create a new file in the home directory of Windows . Ctags , add content:

 --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/ 
  • Execute command under cmd ctags--list-kinds validation

  • /ul>
      ... Go f func v var t type  
    • More extended support can refer to official documentation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.