Sublime Text2+ctags+cscope Alternative Source Insight

Source: Internet
Author: User

Description: Take the example of viewing C + + code under Windows System. Because the source Insight (hereinafter referred to as SI) is the fee software, and the interface is ugly, so consider its alternative, found sublime Text3 (hereinafter referred to as ST3) + Ctags + cscope can achieve good results. The use of ST3 basically enables full keyboard operation, while it does not learn the steep curve of vim.

Installation method: 1. Install package Control for ST3 2. Installing the Ctags Plugin

(1) Installing the Ctags plugin via the Preference package Control--
(2) Download Ctags.exe, copy the contents of Settings Default from Preference, package Settings, Ctags, to Setting user, command": "" ""fill in the path location of the Ctags.exe
(3) Right click on the project root and selectCtags:Rebuild tags

3. Installing the Cscope Plugin

(1) Installing the Cscope plugin via the Preference package Control--
(2) Download the Cscope.exe and generate the Cscope.out file in the project root directory
(3) Open the Cscopesublime.sublime-settings file (which may need to be added to the User directory in the package), "executable": "" fill in the "" Cscope.exe path location, and "database_location": "" "" Fill in the path location of the Cscope.out

Feature implementation:

(1) For the definition query of the symbol function, ST3 comes with this function Go to Definition , and the search results can be previewed when there are multiple, without jumping to another file. Ctags also has this feature navigate_to_definition , search results are more accurate than ST3, but previews are not supported when multiple results are available. Csope also has this feature Cscope: look up function defintion , but the search results do not support double-tap. So the actual use of ST3 and ctags to achieve this function
(2) For the definition query of the symbol variable, ST3 does not support, Ctags has this function, the method is consistent with the definition of its query symbol function. Cscope can also implement this function with the method defined by the query symbol function, which does not support double-click Point Open. So the actual multi-use ctags to achieve this function
(3) For the function caller query, only Cscope has this function Cscope: look up function calling this function
(4) Global search, ST3 can be Ctrl+Shift+F achieved, but the search takes a long time. Cscope can be Cscope: look up symbol implemented because the index has been established through cscope.out, so the results are fast, but the results are not necessarily comprehensive

Note: When using the Cscope function, you need to press the enter key to determine the execution

Comparison: the ST3 + Ctags + cscope scheme basically implements the common and effective functions of source insight (in addition to viewing the class inheritance of relation Windows), and it is faster and the interface more refreshing. Other advantages of ST3 compared to SI include:
(1) ST3 use a Ctrl+P fuzzy match when using a search file, not like Si must be spelled correctly in sequence.
(2) ST3 Support tab mode, easy to switch between multiple files

ST3 Practical Tips:

(1) Alt+O can realize quick switch between header file and source file.
(2) The list of currently open files can be displayed on the left by View-Side Bar
(3) ST3 Although unlike notepad++, you can display a list of functions on sidebar, but you can Ctrl+R view
(3) Preference-Key binding user can customize shortcut keys (including ST3 and plugins) according to their personal operating habits.
(4) Double click to select the Word cursor, three click to select the cursor in the row
(5) Ctrl+Shift+T You can open the tab page that you closed before, which is the same as Chrome

https://www.zybuluo.com/lanxinyuchs/note/33551

Sublime Text2+ctags+cscope Alternative Source Insight

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.