Sublime Text 3 Installation and simple configuration

Source: Internet
Author: User
Tags sublime text

Sublime Text 3, a good text editor, plus a variety of plugins and Ides can be transformed into a variety of languages of the compiler, interface and a variety of plug-ins flexible combination of the programmer in the code of this boring life to add a bit of adjustment.

  

Click Windows or windows64bit under download if your system is 32-bit, then click the former.

If the webpage is not open or very slow, then the installation package for the next version of Windows64bit is available here:

Download link

The link also contains some other plugins, which are then used and can be downloaded together.

After installation, open sublime text 3.

Install the package control plug-in to manage all plugins.

Press CTRL + ~ to bring up the console, such as:

  

Copy the code below and press ENTER.

  

1 Print if Else Open (Os.path.  Join(IPP, PF), ' WB '). Write (by)

After waiting for the prompt to download and install successfully, restart sublime Text 3.

Press CTRL + SHIFT + P to enter the install

  

You can see that the package control has been successfully installed (the first line).

Then the next step is to configure the build environment (C + +)

Here is the MinGW, g++4.8.1 version, the compression package is in the previous link.

First unzip it in a directory, the path is best not to take Chinese or space

1) Add Environment variables

Copy the path of the MinGW and add it to the path variable in the system variable.

    

Remember variables to use, separate, note input method do not switch to Chinese.

Open cmd command (win key + R, input cmd)

Input g++-V If the version number is displayed and the system variable is set successfully, the environment variable needs to be reset.

    

2) Configure the sublime Text 3 file.

Tools--Build system--New build system

  

Copy the following code and save it as a file with the suffix. Sublime-build

Then, in tools-to-build system, select the file you just saved

1 {2"cmd": ["G++.exe", "${file}", "-O", "${file_path}/${file_base_name}"],3"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",4"Working_dir": "${file_path}",5"Selector": "Source.c, source.c++",6"Encoding": "UTF-8",7"Encoding": "cp936",8"Variants":9     [Ten         { One"Name": "Run", A              -"cmd": ["${file_path}/${file_base_name}.exe"], -"Shell":true, the"cmd": ["Start", "cmd", "/k", "${file_path}/${file_base_name} &&echo". & Pause && Exit "] -         } -     ] -}

Here, you can create a new file, save it as a file with the suffix. cpp or. c, and write a Hello World test.

When you're done, pressing CTRL + SHIFT + B pops up two options with the file name you just saved.

The first option without a run is the compile option.

The second one is the Run option.

    

Select the first one, press ENTER to compile, and the following message will appear when the compilation is successful:

    

Press CTRL + SHIFT + B and select the option with Run to run

    

Sublime Text Sublimeclang Plugin

At this point, the build environment has been set up, but a very important feature is missing: code completion. Many functions like STL can not be auto-complete, you need to install Sublimeclang plug-in

Unzip the downloaded Sublimeclang compressed package, and in Sublime Text 3, click Preferences---and Browse Packages to copy the extracted Sublimeclang folder (note that it will become a sub after decompression). Limeclang---Sublimeclang folder in the folder, to copy the inside, and then restart sublime Text 3

    

    

    

    

Configure Sublimeclang,

Preferences--Packages Settings--Sublimeclang---Setting user

Copy the code below and save it with some modifications, then restart sublime Texe 3

    

    

1 {2"Show_output_panel":false,3"Show_status":false,4"Dont_prepend_clang_includes":true,5"Inhibit_sublime_completions":false,6 7"Options":8     [9"-std=gcc4.8.1",Ten"-wno-deprecated-declarations", One"-isystem", "C:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include",//Replace the path one by one of these folders in your MinGW with the corresponding A"-isystem", "c:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++", -"-isystem", "C:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\mingw32", -"-isystem", "C:\\mingw\\include", the"-isystem", "/usr/include", -"-isystem", "/usr/include/c++/*", -"-wall" -     ] +}

Restart Sublime Text 3 to create a new. cpp file test test.

Such as

    

At this point, the general environment has been set up, and then you can according to personal interests and hobbies to install different plug-ins, details please Baidu ~

Sublime Text 3 Installation and simple configuration

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.