Sublime Text 2-the Sexiest code Editor! The programmer must be an artifact! Cross-platform Support Win/mac/linux

Source: Internet
Author: User
Tags sublime text


Code Editor or text editor, for programmers, like Swords and warriors, who want to have a sword that can be mastered and sharp, and every programmer will also pursue the most suitable for their own powerful, flexible editor, I believe you and I, no exception.

I have used a lot of editors, really a lot ~ but there is no one that makes me special favorite, until I met the Sublime Text 2! If the word "artifact" is the highest rating I can give a software, then I would be happy to seal it with such a title. It is small green and very fast, cross-platform support Win/mac/linux, support 32 and 64-bit, support a variety of popular programming language syntax highlighting, code complement the same, but it has a lot of other editors do not have cool features, so that its easy to use to reach an unprecedented degree ...

About Sublime Text 2:

It has been said that there are two kinds of editors in the world, which are easy to use and useless, and in the good editor, there are two kinds, free and death expensive. VIM and TextMate, for example, are examples of free and dead expensive. Unfortunately, today's protagonist Sublime Text 2 is also a dead expensive representative, it is a fee for commercial software, personal licensing fees up to 59 U.S. knives.

But we do not panic, although it is very expensive, but the author is very kind to provide users with free unlimited indefinite trial right, it will only occasionally remind you to buy wood, and the frequency is very low, only that, has been free to use it almost without any impact. It is also worth mentioning that the user to purchase a license can be used on different platforms at the same time, for like I often need to switch between MAC and Win the use of the user can really save a sum of money.

Sublime Text Genuine

Because Sublime Text 2 editor features and the use of the technique is too much, I have not been used to master, so can not enumerate the show, only choose a few I think the characteristics of more features to introduce, and there is no space to introduce a variety of editing techniques, shortcut keys used and so on. If you are willing to take the time to toss, you will find that its ability is far more than the points introduced in this article, so this article can only be regarded as a start, I hope you have good skills to share.

Syntax highlighting, code hinting completion, code folding, customizing skins/color schemes, multi-note pages:

SUBLIMETEXT2 supports but is not limited to C, C + +, C #, CSS, D, Erlang, HTML, Groovy, Haskell, HTML, Java, JavaScript, LaTeX, Lisp, Lua, Markdown, Syntax highlighting for mainstream programming languages such as Matlab, OCaml, Perl, PHP, Python, R, Ruby, SQL, TCL, Textile and XML. ST2 has excellent code auto-completion function (auto brace, curly brace and other matching symbols, automatic completion of the words that have already appeared, auto-complete function name), very smart, and ST2 also has the function of code Snippets (Snippet), you can save the common code snippets, and call them whenever necessary. Of course, syntax highlighting, code folding, line number display, custom skin, color scheme and so on are already a modern editor should have a standard function, so here is not more introduction.

Practical and convenient code hint completion function

Code maps, multiple interface layouts, and fullscreen-free mode:

Sublime text 2 is featured on the interface is supported by a variety of layout and code map, but also provides F11 and shift+f11 into full screen mode, text difficult to describe, see it. Pull to the right to see more pictures >>

Code maps and multi-tabbed pages Multiple layout settings, especially handy when you need to edit multiple files on a large screen Full screen intrusion-free mode for more attention to editing
Fully open user-definable configuration with magical and practical editing state recovery features:

The various configurations of the Sublime Text 2 are controlled by the configuration file, completely customizable by the user, and can even be changed to a completely different operating experience if you are willing to toss it. Looking at the diagram below, the Setting-default menu will open the default software configuration file (which will record a lot of configuration information such as what font to use), key Bindings-default is the default shortcut profile, You can open them to see how some of the original settings are configured, but it is not recommended to modify directly here ! You can do this in the-user end of the file (that is, the meaning of custom configuration) in the same way, if you have the same item on both sides, it will be defined in the-user file.

In this example, I'm in the first line of Key Bindings-user: {"Keys": ["Alt+up"], "command": "Swap_line_up"}, meaning to move the currently selected line up (swap position with the previous line) while pressing ALT + the ARROW key If there is no problem with the syntax, you can use this shortcut immediately after you have saved the file. Sublime text 2 shortcut keys also support dual combination , such as by default, the selected text to uppercase hotkey is "ctrl+k, ctrl+u", meaning when you first press ctrl+k and then quickly press Ctrl+u to trigger (press CTRL + K is not useful), so you can avoid many hot key conflicts, but also more flexible and more selective hot key customization. But here is not going to teach you how to modify various configurations or modify the hotkey, I am afraid to make a manual, here is a more complete set of official documents (birds of the bird), interested friends can refer to. In addition, Sublimetext also has a noteworthy detail-"Edit state Recovery", that is, when you modify a file, but not save, then quit the software, ST2 is not very annoying to remind you to do not save, because whether the user spontaneous exit or unexpectedly crashes the exit, the next time you start the software, Your previous edit status will be fully restored, just like you did before you quit. I think the details are very, very great! Because I often try to modify some of the places, but in order to ensure that there is no problem before you do not want to save, then if some things interrupt themselves, need to leave, this feature is very useful, direct exit on the line, do not bother, next time back to open the software to continue editing. Of course, with this recovery feature is no longer afraid of the system crashes, power off, it is really let people feel ST2 particularly special safe and reliable, and duly!

Powerful multi-line selection and multi-line editing:

In the process of writing code, we often need to edit multiple lines of code or multiple variables at the same time. In Sublime Text 2 has a very practical multi-line operation skills, flexible use can greatly improve the speed of editing yo! I believe that you might ask yourself this question: "How did I ever live with an editor that didn't have this way?" " here are some of the many lines of editing that I've learned: mouse over multiple lines, press Ctrl+shift+l (command+shift+l) to edit the lines at the same time, select the text, press Ctrl+d repeatedly (COMMAND+D) You can continue to select the next same text at the same time to edit simultaneously, the mouse selected text, press ALT+F3 (win) or Ctrl+command+g (MAC) can select all the same text at once to edit simultaneously; right mouse button (win) or option+. shift+ The left mouse button (MAC) or the middle mouse button can be used to select vertical multiple lines with the mouse, CTRL + mouse button (Win) or command+ left mouse button (MAC) can manually select the same time to edit multiple text similar techniques there are many, ask you to add ...

shift+ the right mouse button to easily implement multi-line editing, batch to prefix the variable

Lightning-Fast File switching:

If you open more than one file at the same time, or your project often need to edit different files, when the number of files, in the past often need to spend a lot of effort to find, it is annoying. Now, Sublime Text 2 Just press ctrl+p (Win) or shift+command+p (MAC) to bring up the file switcher, then you just enter the filename, you can switch the past in a moment! And it supports fuzzy matching, just enter the part you remember, such as I want to find a "" file to edit, then you only need to enter "IPL" or "IPS.C" such characters can match out, this feature is very very good!

The CA matches the capabilities.php and classese.php in the diagram, and the selection is quick to switch

Similar functionality, I've only seen it in a large (bulky) IDE like Eclipse, but in a small, fast editor, I've had it for the first time. With this feature, you can switch between open files, if you use Project management (set a folder as a project), and it will also be able to search for files that have not been opened in a matching project folder. Now you need to use the mouse to go to a point tab to switch? Do you want to open "My Computer" slowly in the different folders to find the files that need to be edited? With ST2, you only need to enter a few characters ~ only one sentence: unprecedented convenience!

Jump as you like: Quickly list the elements that are/html with the positioning function, jump to a specified line

With the Quick file switching feature described above, it's easy to open/switch to the document you want to edit, but what if the code for this file is very long and you want to easily jump to where you want to edit it? Sublime Text 2 long ago to help you think of the same is the same as the previous ctrl+p (Win) or shift+command+p (MAC), this time try to enter an @ number to see? Yes, good! This list immediately lists all the Function in this file! Also use fuzzy matching, quickly enter a few keywords, immediately can locate the function to go!!! This feature is especially useful when you need to jump between functions-mom no longer have to worry about me finding the function to find the egg hurts! When you edit the HTML, this goods to you list is the HTML of the various ID elements, I believe that the front-end of the students are chicken frozen bar.

Ctrl+p Enter the @ number or press Ctrl+r directlyto list all the function in the file.

Enter @ To start with this magical effect, then try to enter a colon: start, and then enter a number, well, this time you can jump to the number of lines specified, you can enter a # number to list/search text, and you can also use faster shortcut keys, such as quick list/jump function is Ctrl +r (Mac is command+r), it is exactly equivalent to ctrl+p after entering @; Jump to the specified line number is ctrl+g (Mac is command+g). and even more amazing is that these switching positioning methods you can also use together ! For example, I have a file called "Hello-iplaysoft.js", in which there is a function called "visit_iplaysoft_com", I now want to edit this function, then I just press ctrl+p, and then enter "[Email Protected] "carriage return (fuzzy match, note the character in front of the color), ST2 immediately to open this file and locate it! Is it convenient enough?! By memorizing these shortcuts, you can switch and edit files very one go, and you will find the world a better place to be.

All-in-a-set command panel:

One feature of Sublime Text 2 is that it has a fairly powerful command panel that is almost omnipotent! At any time, press Ctrl+shift+p (Win) or command+shift+p (MAC) to recall. With it, you can implement many, many, many, many features, such as "set syntax:php" to set the current document to PHP syntax highlighting, "Convert Case:swap case" to invert the selected text capitalization; "File:save All" You can save all files at once, "File:close all" closes all files at once, etc... Also, the list here supports fuzzy matching (this goods is really a good thing!). )。 Because this command is too much, the scope of coverage is also very wide, I really can not be introduced here, if you are interested, you can often adjust a panel to see the list of what commands, a lot to understand, try, and then slowly digest, I believe it will let you can not leave it.

Powerful command panel, where you can invoke all the features provided by Sublimetext

Package control (an extension pack manager that must never be missed)

In addition to its myriad of practical features and features, the

Sublime Text 2  can be installed to enhance itself with a variety of extensions/skins/color schemes. Now introduced the package control can be seen as a ST2 extension manager, using it, you can use a very magical, very simple and convenient way to download, install, delete Sublime Text 2 of various plugins, skins, etc., believe me, want to better use ST2 Absolutely not without it! But ST2 itself does not bring this tool, we need to install it ourselves, the method is very simple: 1, in the SUBLIMETEXT2 directory to find the Data > installed Packages folder (if not please manually new) 2, download  PAC here Kage control.sublime-package  file 3, the file will be downloaded into the installed Packages inside 4, restart sublime Text can if the package Control has been installed successfully, then Ctrl+shift+p invoke the command panel, we will find some commands that begin with "package Control:" We often use a few install (installation extensions), List Packages (all extensions listed), Remove Package (remove extension), Upgrade package (upgrade extension). But if you follow the above method does not work, you can try to press the keyboard ctrl+~ (number 1 to the left of the button) to bring up the console, and then copy the following code into and enter, it will automatically help you create a new folder and download the file, and the above method the final effect is the same:

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 ('' +pf.replace (', '%20 '). Read () ); print ' Restart Sublime Text to finish installation '

After the package Control is successfully installed, a series of commands starting with its name appear in the command panel

Entering "package Control:install" in the command panel will list all the extensions that can be installed (must connect to the network, such as), from the list can be seen, 4GL, Aaapackagedev Those are the name of the plugin, Select them to download and install. As you can see from this list, the various extensions of ST2 are now very rich! In addition, you can see the extended list of WEB versions and detailed instructions here (the data for both lists should be synchronized. By the deadline of 2012-7-8, 482 expansion packs have been collected here) I am here to install the "Jsformat" plug-in as an example, a brief introduction to Sublimetext inside how to install and use the plugin bar. Jsformat's function is to re-typeset some messy JavaScript code to make it easier to read and edit. Use Ctrl+shift+p to invoke the command panel, enter "Package Control:install" (Install expansion pack), select Install "Jsformat" in the list of plugins (you can enter character filtering), and the installation is complete after the prompt is successful. Just open a JS file (preferably a newline, a particularly messy kind of), press Ctrl+shift+p to invoke the command panel, you will find that there is an extra command called "Format:javascript",

Format:javascript command using the Jsformat plugin

After use, your code instantly becomes neat and tidy! You can also use the hotkey "ctrl+alt+f" of this plugin to organize (see the command panel to the right).

Using the Jsformat after the JS code effect, note that the JS code is a bunch of

Of course, different extensions, the use of methods and manifestations of the form are not the same, this can only go to the web version of this plugin to check some of the specific use of the instructions, here is not generalize. But in general, installing and using plugins is simple. With a variety of plugins, you can implement virtually any feature you want. And ST2 also open the plugin API, if you have the ability, you can also try to develop one, you can refer to the API documentation here. Some useful plugins are recommended later in this article.

To change a theme or color scheme:

If you are tired of sublimetext the original skin, you can also toss a change of skin. For example, a popular theme, Theme-soda, is basically the same as installing plug-ins, using the package Control to go to the Install package list and find it for installation. You can also find some ST2 themes on the Internet, download them back into the Data\packages folder of the installation directory, and choose to switch themes. The operation of the color scheme is similar, we have to study it, there is not much to do introduction. In addition, Sublimetext also has a very strong point, is that it can natively support textmate Bundle and color scheme, is also placed in the Packages folder can be used. TextMate Bundle and color scheme resources are relatively rich, online can find a lot.

Sent to the big city chubby classmate made Sublime Text 2 Introduction Video: Recommended part of the plugin:

Here to add some I think good plug-in bar, welcome you to recommend and add:
Gits: Easy to integrate with GitHub
SFTP: Directly edit files on an FTP or SFTP server
Zencoding: The goods for the front-end students, can be very fast to write HTML files (video presentation)
Converttoutf8:st2 only supports UTF8 encoding, the plugin can display files encoded with edit GBK, BIG5, Euc-kr, EUC-JP, Shift_JIS, etc.
Clipboard History: Clipboard Histories
WordPress: Integration of some WordPress functions, for like I often write WP templates and plugins are particularly useful!
Htmltidy: Clean and typeset your HTML code
Phptidy: Collating and typesetting PHP code
YUI Compressor: Compressing js and CSS files

Some additions:

Because Sublimetext is green software, the user's custom configuration, download plug-ins and so on are located in the software directory, so once you have configured, using Dropbox, Jinshan fast disk and other synchronization network synchronization (no network friends with a USB stick), go to where to run are their own configuration, Very convenient! In the future, we can work on different computers and believe it will be handy.

In addition, many friends reflect that open Chinese will be garbled, in fact, because ST2 itself only support UTF-8 encoding, and we often encounter the Chinese file may be GBK or GB2312 encoding, the solution is to install a ConvertToUTF8 or GBK Encoding Support plug-ins can be solved perfectly, this is not a big problem.

Write in the back:

I have been using the editor is EditPlus, at least 4 years +, the main reason is that it started quickly and long-term use has been accustomed to, but this time after the trial I did not hesitate to mutiny to SUBLIMETEXT2 come! From a variety of usage experiences, the most ST2 feel is "fast" and "smooth". "Fast" just like the Chrome browser compared to other general browsers, the startup speed is very satisfying; "Fluency" is when you are familiar with some of its quick operations, editing documents that do not need to disrupt the flow of thoughts of the operation, very people have a sense of accomplishment! As a function, extensibility is so powerful, configurable so free software, can do so fast is the ultimate, think of those large and bulky IDE, you can not wait to tell everyone in the world and sublimetext such an artifact ~

Sublime Text 2 is a great advantage over textmate in cross-platform and software updates, and is much simpler than another artifact-level editor for VIM, which is lighter and faster than the larger Ides, and more powerful than most editors on the Web, And the dark color of the interface is very cool and pleasing people, can be said to be at present in addition to vim, Emacs and another code editor of the best choice! (more modern and more advanced interface than vim for ordinary users)

Of course, the ultimate editor is like a novel sword, from adaptation to flexible use takes a long time to adhere to, learn and try. It is recommended that you learn a lot about it and learn its various shortcut keys, so write code like the need for the speed of the car ah have wood. At present, I am just getting started, a lot of skills, shortcuts and features are still useless to come up, so I hope that experts from all walks of life, more with me to share some ST2 practical skills and tutorials, it is appreciated!

Related documents:

Official website: Visit
Software Nature: Toll + Free unlimited trial

Download SublimeText2 (WIN32-bit green edition) |  64-bit Green Edition |  From the different meta |  Mac Edition |  Linux32 bit, 64-bit | More code-related

Sublime Text 2-the Sexiest code Editor! The programmer must be an artifact! Cross-platform Support Win/mac/linux

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.