Quick start and common tips for Sublime Text 2

Source: Internet
Author: User


1. Install the Extender Pack Manager Package Control component
    • Click on the menu View, Show console to bring up the console or press the shortcut key "Ctrl +" (1 left of the symbol, may and QQ Pinyin input method and Sogou browser shortcut keys have conflict, can be changed)
    • Enter the following code 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
    • If you see the package control item in Perferences->package settings, the installation succeeds. If this method cannot be successfully installed, you can download the file here manually (Https://sublime.wbond.net/installation).
 


2. How to install plug-ins with the package control:


    • Click the menu press Ctrl+shift+p to bring up the command panel
    • Enter install to bring up the Install Package option and enter, then select the plug-in you want to install in the list.
    • Basic command, install plug-in, list list installed plug-ins, remove removed installed plugins, upgrade upgrade plugin, disable disable plugin, enable plugin
3. Common Plugin Introduction
    • GBK Encodingsupport: Chinese plugin
For gb2312, Sublime Text 2 native unsupported, install "GBK Encoding support" plug-in, open GBK encoded files will not appear garbled, if there is a need to turn utf-8 can be in FILE-GBK to Utf8-choose Save with UTF8 to do it.
    • Sublimecodeintel Code automatic Hints
Support for JavaScript, Mason, XBL, XUL, RHTML, SCSS, Python, HTML, Ruby, Python3, XML, Sass, XSLT, Django, HTML5, Perl, CSS,        Twig, less, Smarty, node. js, Tcl, Templatetoolkit, PHP. The shortcut keys are as follows: jump to Definition =Alt+Click
Jump To Definition =Control+Windows+Alt+Up
Go back =Control+Windows+Alt+Left
Manual Code Intelligence =Control+Shift+space 
    • ConvertToUTF8 Conversion GBK encoded to UTF8 encoding


Select all text, shortcut key "Ctrl + Shift + C"


    • Jsminifier


The plugin automatically compresses JS files based on Google Closure compiler.


    • JS Format
JS Code formatting plugin, shortcut key "Ctrl + Alt + F"
    • Jquery
jquery function Hint Plugin
    • Tag
HTML code formatting tags, shortcut keys "Ctrl + Alt + F", or right-click to find the appropriate function
    • Imesupport
Input box follow plugin for Chinese input method 4. Shortcut key Operation Interface
    • F11 fullscreen
    • Shift+f11 stemless around Fullscreen
    • Ctrl+k+b Switch Side bar
    • alt+shift+ Number: Split screen display
    • Ctrl+i: Displays the bottom panel:




Edit:
  • F6 spell checker
  • ctrl+/Comment Entire line (if selected, same as "ctrl+shift+/" effect)
  • ctrl+shift+/Comment Selected content
  • Ctrl+d Word selection (press and hold-continue to select the next same string)
  • Alt + F3 Select all the same words
  • Ctrl+m cursor to start or end position within parentheses
  • CTRL + Z Undo
  • Ctrl+y Recovery undo
  • ALT +. Close the current label
  • CTRL + N: New window
  • Ctrl + Shift + L break the current selection and edit it at the same time
  • Ctrl + J to merge the current selection into one row
 Find/ replace
    • Ctrl+f: Find Content

    • Ctrl+shift+f: Find and replace

    • Ctrl+h: Replace

    • F3 Find Next:

    • Shift+f3 to find the previous one:

  5. Individual user settings, menu preference-Settings-user//Set Font size"Font_size"://Highlight Current line"Highlight_line": true,//Make the cursor blink more softly" Caret_style": "Phase",//Highlight modified labels"Highlight_modified_tabs": true,//Set Tab size to 2"Tab_size": 2,//Automatically remove end of line when saving"Trim_trailing_white_space_on_save": true,  6.Sublime Text 2 run JS method
    • Install node. js
    • Sublime Select Menu Tools---Build system--New build system ..., write the following:
 
{
    "cmd": ["node", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "working_dir": "${project_path:${folder}}",
    "selector": "source.js",
    "shell": true,
    "encoding": "utf-8",
    "windows": {
        "cmd": ["taskkill /f /im node.exe >nul 2>nul & node", "$file"]
    },
    "linux": {
        "cmd": ["killall node; node", "$file"]
    }
}
then save as Javascript.sublime-build, save location by default
    • Try a new test.js, press CTRL + B or F7 to run









Reference Blog: http://www.cnblogs.com/52cik/p/3807027.html

Http://www.cnblogs.com/figure9/p/sublime-text-complete-guide.html





Quick start and common tips for Sublime Text 2


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.