Speaking of the editor, most people may recommend vim and Emacs. I have used vim, which is really powerful, but I am not very used to it. I have always recommended sublime text 2 as an editor, then I tried it during this time, and I really liked this editor. For similar editors, I used notepad2, notepad ++, editplus, ultraedit, Vim, and textpad, I didn't think any editor was very easy to use until I met sublime text 2. I had been searching for a useful ide when I wrote a Python script, I have used wingide, ulipad, pycharm, eclipse + pydev, and pyscrypter. None of them really liked it until I met sublime text 2, today, let's talk about how to create sublime text 2 into a useful ide. Although it is just an editor, it has a wide range of extensions, it is enough for us to turn it into a good ide.
1. Download and install
Sublime text2 is an open-source software that can be used without registration (although there is a pop-up window when it is not registered, it basically does not affect usage ).
: Http://www.sublimetext.com/. Please download the package on your own. After the download, install the SDK directly.
The default sublime configuration file is in the C directory. If a friend feels that the C disk is not suitable, do not directly run sublime after installing sublime, enter % appdata % in the address bar, delete the sublime text 2 folder under the directory, create a folder named data in the installation directory of sublime, and then run sublime, all the configuration files about sublime will be stored in the data directory.
If a friend is not used to the English interface, he can use the Chinese package for localization. I have uploaded the Chinese package to the blog space and can download the package.
Http://files.cnblogs.com/dolphin0520/sublime%E6%B1%89%E5%8C%96.rar package address:
Localization Method:
1. Run sublime text 2;
2. Select preferences> browse packages ";
3. Find the "default" folder and copy the extracted file to the "default" folder to overwrite it.
The following is the running interface after the Chinese version:
The following message is displayed when sublime is disabled:
By default, there will be an update prompt dialog box in sublime. you can disable the update prompt by setting the method:
Select "Preferences"-> "Browse packages" to find the preferences in the default folder. sublime-settings, add a line at the bottom (note that you must add a comma at the end of the previous line ):
"Update_check": false
Save and exit and restart sublime.
2. Some common settings and shortcut keys
1. font and theme style settings
When you need to change a theme, you can directly set it through "preferences"-> "color theme:
Only the font size can be changed on the main interface:
To change the font and font size, you can first "Preferences"-> "Browse packages", find the "default" folder, and then find preferences. sublime-settings: Use sublime text 2 to open the file, which saves some common settings,
For example, Font, theme style, whether to display the line number, smart prompt Delay Time, etc. You can set it as needed.
2. Open (close) the sidebar, right thumbnail, and other commonly used panels
By default, sublime text 2 does not open the sidebar file browser. You can use "View"-> "sidebar"-> "Hide sidebar" to open or close the sidebar.
By default, sublime text 2 has a file thumbnail on the right. You can open and close the thumbnail through "View"-> "Hide mini map.
3. Search for files and defined functions with the shortcut key
In sublime text 2, you can quickly switch to the desired file. You only need to press Ctrl + P to open the switch panel.
Enter the name of the file you want to find to quickly switch to the file. If you want to find a function, you can quickly switch to the file that defines the function by entering "@ + function name.
3. Some necessary plug-ins.
The following describes some common plug-ins necessary for sublime text 2.
All plug-ins installed in sublime text 2 and preset plug-ins are in the packages file and can be accessed directly through "Preferences"-> "Browse pakcages.
There are two ways to install the plug-in sublime text 2:
1) download the installation package offline, decompress the packages Package, and restart sublime.
2) install package management plug-in online. Before installing packages control, install the package management plug-in as follows:
Select "View"-> "Display Console", and enter the following in the pop-up box:
import urllib2,os;pf=‘Package Control.sublime-package‘;ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),‘wb‘).write(urllib2.urlopen(‘http://sublime.wbond.net/‘+pf.replace(‘ ‘,‘%20‘)).read())
Then press enter to confirm. After the installation is complete, restart sublime. If you find package control in perferences, the installation is successful.
Then you can open the Command Panel through "Ctrl + Shift + P" and enter the "Install" command to view the installation package list.
We recommend several necessary common plug-ins below:
1. Tag plug-in
The tag plug-in can provide HTML and CSS labels for Web developers, which is convenient and convenient for Web Front-end designers.
2. prefixr plug-in
Provide some prefixes for css3, such
3. Terminal plug-in
The terminal plug-in allows you to open the CMD command window in sublime text2. It is a practical plug-in. After the plug-in is installed, the shortcut key for opening the CMD command window is
CTRL + Shift + T.
4. sublimetmpl plug-in
This plug-in allows users to define file templates. For example, when writing an HTML file, the introduction information of repeated file headers is cumbersome. You can define a template to directly generate required information, for specific sublimetmpl plug-in usage, Baidu.
5. sidebarenhancements plug-in
A plug-in that enhances the browsing function of the sidebar folder.
6. docblockr plug-in
The plug-in used to generate the comment block. After installation, enter "/*" and press enter to generate the code comment block.
7. sublimecodeintel plug-in
Smart notification plug-in. This plug-in provides a powerful smart notification function. You can customize the prompt content library and set the python smart prompt (the configuration file path is packages \ sublimecodeintel-master \. codeintel \ config:
{
"Python": {
"python":‘D:/Program Files/Python26/python.exe‘,
"pythonExtraPaths": [‘D:/Program Files/Python26‘,‘D:/Program Files/Python26/DLLs‘,‘D:/Program Files/Python26/Lib‘,‘D:/Program Files/Python26/Lib/plat-win‘,‘D:/Program Files/Python26/Lib/lib-tk‘,‘D:/Program Files/Python26/Lib/site-packages‘]
}
}
Among them, "pythonextrapaths" is the content library required for smart prompts.
8. andypython plug-in
A smart reminder plug-in for python. The keywords and functions to be prompted can be set in packages \ andypython \ pythoncompletions. py.
9. andyjs2 plug-in
A plug-in for javsscript and jquery smart prompts.
10. jquery plugin
Jquery prompt library.
11. ctags plug-in
This plug-in allows you to quickly locate the function definition.
12. To avoid gibberish when opening a file containing Chinese characters, you must first install the GBK encoding support plug-in and then install the converttoutf8 plug-in.
If a friend finds it annoying to have a pop-up window when he does not register, here is a solution:
Open the sublime_text.exe file in the sublime text 2 installation directory with a hexadecimal Editor (I use ultraedit here). Back up the file before that. If the file is not cracked, it can be restored and then located at the row 000cbb70, find 8A C3, change it to B0 01, and save it. This is the successful registration cracking interface:
For more information about sublime text 2, you can find relevant information on GitHub for some plug-ins. Let's try the convenience of sublime text2.