Sublime2 Configuring Python and C + +

Source: Internet
Author: User

Common shortcut keys

1.ctrl + ' Bring up console 2.ctrl+shift+p bring up command panel 3.ctrl + w close current tab 4.ctrl + SHIFT + t restore last closed label 5.ctrl + N new file 6.ctrl + p find file 7.ctr L + F looking for keywords

8.ctrl + D Display key word 9.alt + F3 Select all key words can edit replace

You can modify the default shortcut keys and set new shortcuts in key-building.

Download Sublime and install the package control plugin

Ctrl + ' bring up the console and enter the following code

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

Two at the time of debugging due to the configuration of environment variables, the ASCII character set is missing in the character set of environment variables

Locate the Profile directory location (in sublime text 2, preference, browse Packages) to find exec.py, edit in the default directory;

Find the following two lines:

For K, V in Proc_env.iteritems ():            proc_env[k] = Os.path.expandvars (v). Encode (sys.getfilesystemencoding ())

  

Change to:

For K, V in Proc_env.iteritems ():            try:                proc_env[k] = Os.path.expandvars (v). Encode (Sys.getfilesystemencoding ( )            except Unicodedecodeerror:                print ("Encoding error")                print ("VARIABLE:", K, ":", V)

Configure Python

Download Python 27

1. Add environment Variables 2. Modify the configuration file

Preferences->browse Packages->python folder, find Python.sublime-build

Change the contents to read as follows

{"cmd": ["Python", "-U", "$file"], "path": "C:/python27", "File_regex": "^[]*file \" (... *) \ ", line ([0-9]*)", "selector": "Source.python"//"encoding": "cp936"}

Configuring C + +

Download MinGW32

1. Add environment Variables 2. Modify the configuration file

Preferences->browse packages->c++ folder, find C++.sublime-build

Change the contents to read as follows

{     "cmd": ["g++", "${file}", "-O", "${file_path}/${file_base_name}"],     "File_regex": "^ (.. [^:]*]:([0-9]+):? ([0-9]+)?:? (. *) $ ",     " Working_dir ":" ${file_path} ",     " selector ":" Source.c, source.c++ ",     " encoding ":" cp936 ",     " Shell ": True,     " variants ":     [          {               " name ":" Run ",               //" cmd ": [" cmd ","/U ","/C "," g++ ${file}-o ${file_ Base_name} && ${file_base_name} "]                " cmd ": [" Start "," ${file_path}/${file_base_name}.exe "]          }     ]}

Common plugins

1.Terminal Plug-in

Terminal plug-in can allow the cmd command window to be opened in sublime Text2, a useful plug-in, good installation of the plugin, Open cmd Command Window shortcut keys are

Ctrl+shift+t.

2.SublimeTmpl Plug-in

This plugin allows users to define the template of the file, such as in the writing of an HTML file, always repeat the file header some of the introduction of information is very cumbersome, you can define a template directly generate the necessary information, the specific Sublimetmpl plug-in usage please Baidu itself.

3.SideBarEnhancements Plug-in

A plug-in to enhance the Sidebar folder browsing function, relatively good.

More Plugins Introduction http://www.cnblogs.com/dolphin0520/archive/2013/04/29/3046237.html


Sublime2 Configuring Python and C + +

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.