Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of realizing function tracking Jump (ctags) in sublime text

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the method of realizing function tracking jump (ctags) in sublime text. It is very detailed and has certain reference value. Interested friends must read it!

A very useful feature in source insight is the tracking jump of the function, which makes it easy to browse the original function when reading other people's code. We know that there is a plug-in called ctags when using vim, and in the same way, ctags can be used to achieve the same function in sublime text.

Here is how to install and use ctags in sublime text:

1. Install package control: (ignore if installed)

(see https://packagecontrol.io/installation#st3)

Simple installation method:

From the menu View-Show Console or ctrl + ~ shortcut key, call up console. Paste the following Python code in and execute it with enter, and the installation will be completed without accident. The following provides the installation code for ST3 and ST2:

Sublime Text 3:

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 ())

Sublime Text 2:

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 ('Please restart Sublime Text to finish installation')

Manual installation:

You cannot install using code for a variety of reasons, so you can install Package Control manually by following these steps:

11. Click Preferences > Browse Packages menu

twelve。 Enter the upper directory of the open directory, and then enter the Installed Packages/ directory

13. Download Package Control.sublime-package and copy it to the Installed Packages/ directory

14. Restart Sublime Text.

Download address of Package Control main file: https://github.com/wbond/sublime_package_control

How to use it:

Shortcut key Ctrl+Shift+P (menu-Tools-Command Paletter), type install to select Install Package and enter, enter or select the plug-in you need to enter and install it (note the small text changes in the lower left corner, it will prompt the installation to be successful).

2. Download the latest ctags to a non-Chinese directory. Here, we recommend that c:\ windows\ system32,ctags can be downloaded from http://ctags.sourceforge.net/. The last update is in 2009, version 5.8

After download, extract the ctags.exe to the c:\ windows\ system32 directory

3. Install ctags under package control install in sublime text

Shortcut key ctrl+shift+p, type pci, and then type ctags on the command line to install

4, configure the ctags path

Open the settings-default of ctags, copy all the code, and paste it into setting-user

And add your ctags path to the above location

5, use, before using the function transfer function, you need to create a .tags file, just right-click on the project file in the project file manager and click Ctags:Rebuild Tags (note that .tags may be regenerated after changing the file)

6. After all the work is ready, you can right-click on the function name and click the navigate header definition to jump to the specified function and return it with jump back.

These are all the contents of this article entitled "how to implement function tracking Jump (ctags) in sublime text". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report