Sublime text 2 install Zen coding and Other plug-ins

Source: Internet
Author: User
Tags sublime text
Package Control)

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.

 

 

 

Install Zen Coding

1. Download the Zen coding plug-in package
Address 1:Https://bitbucket.org/sublimator/sublime-2-zencoding/get/495292bf418e.zip
Address 2:Http://download.csdn.net/detail/xnlpktg/3607395
1. Open sublime and select prefreences> browse packgaes... to bring up the plug-in installation location;
2. Change the downloaded plug-in package to "Zen coding" and copy it to the position displayed in step 1;
3. Restart sublime;
4. Go ~! Call out is the same as Mac CTRL + ALT + enter

PS: Pay attention to the path level of the plug-in. If there is more plug-in, it cannot be used.

 

 

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. Now, by selecting the text and pressing SHIFT + command +Ctrl + 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. Inputsettings userCall upPreferences:Settings - UserAnd press Enter.

    The preceding two steps can also be used directly.cmd + ,Complete.

  3. A preferences. 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.

Modify "Preferences"-> "File Settings-more"-> "distraction free-user" to set the anti-interference mode:

{"Line_numbers": false, // whether to display the row number "gutter": false, // whether to display the edge column "draw_centered": True, // whether to center "wrap_width ": 80, // wrap width (unit: character) "word_wrap": True, // whether to wrap automatically "scroll_past_end": True // whether the scroll length exceeds the end}
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.

The preferences: settings-user:

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

  2. Inputuser settingsCall upPreferences:Settings - UserAnd 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.

Command line tool

Like textmate and macvim, sublime text 2 also provides a convenient command line tool to quickly call the sublime text 2 program through a terminal to open files, directories, and projects.

To use the command line tool, you need to create a symbolic link and run it in the terminal (terminal. app:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

Then runsubl --helpYou can viewsublCommand usage:

123456789101112131415161718
Use: subl [parameter] [file] to edit the specified file or: subl [parameter] [Directory] to open the specified directory or: subl [parameter]-edit stdin available parameters: -- project <project>: Read the specified project -- command <command>: run the specified command-N or -- New-window: open a new window-A or -- add: add a folder-W or -- wait to the current window: wait until the file is closed and return-B or -- Background: Do not activate the program window-S or -- stay: after closing the file, keep the program window active-H or -- help: Show this help-V or -- version: show the version number to use the -- Wait parameter when reading stdin. You can use -- stay to disable the function of returning a terminal (only for a single file) after the file is closed ). You can add the ': row number' or ': row number: column number' suffix to the file name to open to a more specific location.
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, there is no limit to trial use in the current test phase.

For more articles about sublime text 2, see here.

 

 

Reference link:

Http://lucifr.com/139225/sublime-text-2-tricks-and-tips/

Http://istyles.blog.163.com/blog/static/181100389201181944849545/

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.