Sublime Text 2

Source: Internet
Author: User

After reading Nettuts +'s introduction to Sublime Text 2, I was immediately excited. As the author Jeffrey Way said: "The Duke of eternal destruction has been released, and TextMate 2 has not been released ", can you still count on it? The negative attitude of TextMate developers is intolerable. As a Text editor across OS X, Linux, and Windows platforms, the Sublime Text 2 feature is gaining momentum from TextMate,

Here is a rough translation of Nettuts +. Although it is not comprehensive, it is enough to get started with Nettuts +. The Mac version is the main version, but it is also the same for Windows and Linux versions.

Content list
Change to a nice icon
Try to develop a version
Quick Command Panel
Instant file Switching
Multi-Selection)
Indent Guide)
Package Control)
Alignment
Vim Mode
Distraction Free Mode)
TextMate Bundle
Topic
Summary
Change to a nice icon

Sublime Text 2 is currently in the testing stage. The default black box icon does not seem eye-catching. Nate Beaty has made a good alternative.

Mac replacement method:

  • InApplicationsFind Sublime Text 2 in the directory, press Ctrl and click it, and select "show Package content" in the pop-up menu ".
  • EnterContents/Resources/Directory, replaced by the new downloaded iconSublime Text 2.icns.
Try to develop a version

Sublime Text 2 is currently very active. If you want to try the latest features, we recommend that you download and install the dev version.

Download Sublime Text 2 Dev

Quick Command Panel

Similar to TextMate, Sublime Text 2 also provides a convenient Command call method: Command Palette (Command Panel ). Call method: directly inToolSelectCommand Palette, Or use the shortcut key:Shift + Command + PEnter the command name (letters in) to search for the corresponding commands, options, snippet, and syntex in real time. Press enter to directly execute the command, reducing the trouble of searching.

Instant file Switching

PressCommand + P(Mac) orCtrl + P(Windows), you do not need to press the Enter key to enter the name of the file you want to switch to. The target file is already displayed. Even if Vim works with PeepOpen, the same function can be achieved, however, the speed is far from that fast.

Multi-Selection)

The multi-choice function allows multiple cursors to exist on the page at the same time, making it easy for many tasks that require regular expressions, advanced searches, and replacements. Check whether the instances provided by Nettut + are more intuitive:

There are two methods to activate Multiple choices:

  • Press and holdCommandOrAlt, And then click at the cursor position on the page.
  • Select several lines of text, and then pressShift + Command + L.
Indent Guide)

Indentation indicates that this small function can make the hierarchical relationship of code clearer. In Sublime Text 2, this function can be implemented through a plug-in.

Installation Method:

  • Download the IndentGuides plugin.
  • After decompression, rename the folderIndent GuidesAndPackagesDirectory. FindPackagesThe Simple Method of directory is in Sublime Text 2PreferencesSelectBrowse Packages.
  • Restart Sublime Text 2
Package Control)

Is the method for installing plug-ins in the previous article very troublesome? In fact, like TextMate which can install Bundle and Plugin, Sublime Text 2 also has a good extension function, which is the Package. Similarly, just like TextMate is used to install, upgrade, and uninstall the GetBundles of Bundle, Sublime Text 2 also has a plug-in for Package Control: Sublime Package Control. With Sublime Package Control, you can easily install, upgrade, and uninstall a Package.

How to install Package Control:

  • Open Sublime Text 2, and pressControl + `Call up Console
  • Paste the following code into the command line and press Enter:

    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())

  • Restart Sublime Text 2. IfPreferences -> Package SettingsSeePackage ControlThis indicates that the installation is successful.

The method for installing a Package using Package Control will be detailed later.

Alignment

For some coders who like to tidy up, it may be intolerable to see the following situation:

var joe = 'joe';var johnny = 'johnny';var quaid = 'quaid';

You must change it to this to feel at ease:

var joe    = 'joe';var johnny = 'johnny';var quaid  = 'quaid';

TextMate also has this function (Option + Command + ]) Can automatically implement the above Alignment process, and in Sublime Text 2, a Sublime Alignment plug-in can also be easily implemented.

Install this plug-in through Package Control:

  1. PressShift + Command + PCall up the command panel.

  2. InputinstallCall upPackage Control: Install PackageOption. Press enter.

  3. FindAlignment, Press enter to install.

  4. Restart Sublime Text 2 to make it take effect. Select the text and pressShift + Command + AYou can perform the alignment operation.

By using this method, you can easily install more plug-ins. Although there are not many plug-ins currently installed in the source, I believe they will be richer in the future.

Vim Mode

Yes, Sublime Text 2 dev already supports Vim's editing mode. If you prefer Vim's editing mode, you can activate Vintage mode using the following methods:

  1. PressShift + Command + PCall up the command panel.
  2. Inputuser global settingCall upPreferences:User Global SettingsAnd press Enter.
  3. At this time, a Global. sublime-settings file will be opened. If this is the first modification, it should be an empty file and paste the following text into it:

    {    "ignored_packages": []}
  4. Save the file, Press ESC, and then press some familiar Vim commands. Is it very friendly?

Distraction Free Mode)

If there is no interference-free mode in the current editor, it seems that it cannot be said. In Sublime Text 2, just pressControl + Shift + Command + FOr in the menuViewSelectEnter Distraction Free ModeYou can enter the UI minimization mode. If Mac OS X Lion is used, Sublime Text 2 also supports the native full-screen mode of Lion.

TextMate Bundle

Sublime Text 2 is strongly supported at the same time.SomeThe Bundle of TextMate.

Sublime Text 2 has good native support for Snippet in TextMate Bundle, and can be used by placing the Bundle in the Packages directory. However, the command in the Bundle is not supported. In addition, the color subject of TextMate[1] can also be directly used in the Packages directory. It is estimated that as Sublime Text 2 becomes increasingly popular, more TextMate Bundle will be transplanted.

Topic

The topic here is different from the Color Scheme for code. It is a pointer to the topic of the Sublime program. Currently, Ian Hill's Soda can be installed.

Because the source has been added, It is very convenient to install this topic through Package Control. Currently, the Soda topic provides two styles: light and shade.

To activate the Global Settings:

  1. PressShift + Command + PCall up the command panel.

  2. Inputuser global settingCall upPreferences:User Global SettingsAnd press Enter.

  3. Add the following code to activate the Soda Light topic:

    {    "theme": "Soda Light.sublime-theme"}

    Add the following code to activate the Soda Dark topic:

    {    "theme": "Soda Dark.sublime-theme"}
  4. Save and take effect.

Summary

During the trial of Sublime Text 2,FastAndShun"Is the most intense feeling for Lucifr, just like the Chrome browser, all kinds of Sublime operations give people a very smooth feeling. Good Chinese support is not available in TextMate. Although TextMate cannot be completely replaced by the current number and quality of plug-ins, it is still very promising. The only Tangle is the price. The registration price of $59 is really not cheap (it is determined by the $58 of TextMate). Fortunately, you can try it out without limit in the current test phase.

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.