Sourceinsight3.5 tool Configuration

Source: Internet
Author: User

Sourceinsight 3.5 with a registration Machine

Create a project

After installation, select project-> new project as the project directory, and then select the source code directory,

We recommend that you do not associate the source code directory with the project directory, because sourceinsight will generate some files (some data files) in the project directory ),

In addition, sourceinsight automatically runs options-> Save configuration. These files are stored in my documents by default-> source insight.

. If you uninstall the software, it will be automatically saved here, And you will use these configurations in the next installation.

1. Make the. CC file support color

Importing the C ++ project does not support. CC files. Why is it not supported by CC sister? Make sure that the configuration is complete.

Options-> document options-> document type file filter: Add *. CC to it and close it.

Screen fonts can also be used to adjust the font size (it is recommended that you do not adjust the font in disorder and adjust the Font too sadly)

This solves the problem of how to support. CC files.

2. tabsiplus paging plug-in

I found that after opening multiple files, there is no "paging Task Bar", that is, there is no tab. I checked it online and there is a plug-in to handle it,

Download a tabsiplus_0_99b2_1510.rar file. The tabsihost.exe file is safe and convenient.

3. Redirection between header files and source files

In the. h file, press Ctrl on the name of a function and the mouse pointer will become a hand shape. You should click it to jump to the source code, but we found that

He can't jump to the source code. The reason is the author's way of organizing the source code. In. H, it is put into a namespace.

The namespace muduo {} is used to enclose the class code. Does it mean that this source code viewer does not support namespaces. No, I thought

How is the namespace used by the author's source code? This is using namespace muduo. Let's comment it out. If so

Namespace muduo {} Put the source code in it. In this way, you can click CTRL in. h to locate the. CC file,

The original reason is the author's source code organization. Isn't that troublesome. Or move the cursor to The. H function name,

The code for this interface is displayed in the window below. You can also double-click it to enter the source code (it is easy to jump over ).

However, because the author's source code is organized by using namespace muduo; this is the case, we cannot change all of its code.

What should we do? It is best to set something to switch back and forth between the header file and the source file, which can save some trouble,

Even if we cannot skip, you can jump to the source file by pressing a shortcut key.

Close the project first. There is a base project in the project-> open project (sourceinsight has a project by default,

In this project, there is a utils. Em file. Open it. At the end of this file, add the code

/* CPP and HPP file Interchange (currently only files in the same directory can be exchanged) */macro switch_cpp_hpp () {hwnd = getcurrentwnd () hcuropenbuf = getcurrentbuf () if (Bytes = 0) Stop curopenfilename = getbufname (hcuropenbuf) bytes = strlen (curopenfilename) // file type temporary buffer strfileext = newbuf ("strfileextbuf") clearbuf (strfileext) // header file type index_hpp_begin = 0 // the header file starts indexing appendbufline (strfileext ,". H ") appendbufline (strfileext ,". HPP ") index_hpp_end = Getbuflinecount (strfileext) // end index of the header file // index_cpp_begin = index_hpp_end // start index of the source file appendbufline (strfileext ,". C ") appendbufline (strfileext ,". CPP ") appendbufline (strfileext ,". cc ") appendbufline (strfileext ,". CX ") appendbufline (strfileext ,". cxx ") index_cpp_end = getbuflinecount (strfileext) // end index of the source file iscppfile = 0 // 0: Unknown 1: header file 2: source file, the default unknown extension is curopenfileext = "" // The name of the file that is currently being opened. Index = index_hpp_beg In // traverses the header file and determines whether the file is currently open. The header file type is while (index <index_cpp_end) {curext = getbufline (strfileext, index) curextlen = strlen (curext) curopenfileext = strmid (curopenfilename, folder-curextlen, folder) // the extension of the currently opened file // debug // encrypt (debugbuf, curext) // appendbufline (debugbuf, curopenfileext) if (curopenfileext = curext) // match successful {If (index <index_hpp_end) iscppfile = 1 // The current open file is the header file els Eiscppfile = 2 // source file break} Index = index + 1} // while (index <index_cpp_end) // debug // appendbufline (debugbuf, iscppfile) else = incluindex_replace_end = index_hpp_end if (iscppfile = 1) // The current file opened is the header file {else = index_cpp_begin index_replace_end = index_cpp_end} else if (iscppfile = 2) // The current open file is the source file {index_replace_begin = index_hpp_begin index_replace_end = index_h Pp_end // debug // appendbufline (debugbuf, "CPP")} else // unknown type {// closebuf (strfileext) // disable the buffer // stop index_replace_begin = 9999 index_replace_end = index_replace_begin // The following loop will not be executed} Index = while (index <index_replace_end) {destext = getbufline (strfileext, index) destfilename = strmid (curopenfilename, 0, curopenfilenamelen-strlen (curopenfileext) // does not include the extension, absolute path // try whether the current target extension can open destfile Path = CAT (destfilename, destext) // file name (including extension) hcuropenbuf = openbuf (destfilepath) if (hcuropenbuf! = 0) {setcurrentbuf (hcuropenbuf) break} // try to replace the directory to see if the file can be opened (how to design: support multiple directories )//... (not supported by likes) Index = index + 1} closebuf (strfileext) // disable the buffer // debug // appendbufline (debugbuf, "finished ")}

Open option-> key assignments. Select "macro: switch_cpp_hpp" in the Command column ";

Click the assign new key button to set the shortcut key (CTRL + ·), click OK, and set it. At this time, you can press Ctrl +. in. CC files and. H files are switched back and forth.

Open-source C ++ projects all have their own namespaces

4. Spacing Between fonts in Chinese comments

Options-> style Properties
Modify comment font name to .

5. configuration file Problems

The configuration file of sourceinsight is saved in my document. In sourceinsight, it is best to delete this file when you uninstall the software, and each project can have its own exclusive configuration file.

6. Why does the page disappear after the machine is shut down and restarted and the EXE has to be restarted?

Close sourceinsightand disable tabhost.exe.
So you can use
However, if you shut down, you can restart tabhost.exe.

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.