Sublime Text 3 Installation and use

Source: Internet
Author: User
Tags sublime text

Sublime Text 3 Installation and use

This article is sublime Text full guide by Lucida (http://www.cnblogs.com/figure9/p/sublime-text-complete-guide.html) notes, and added some of their own organized content , thanks to the original author.

1. Download

Can be downloaded from official website HTTP://WWW.SUBLIMETEXT.COM/3.

2. Install under Windows and use 2.1 installation

1. Win7 64-bit system, you can download the Windows * bit to install.

2. When installing, be careful to check the Add to Explorer context menuso that sublime text can be added to the right button, and when you right-click the file, you can open it directly using sublime text.

2.2 Installing the plug-in 2.2.1 package Control

1. Sublime text can use the package Control to make it easier to browse, install, and uninstall plugins.

2. How do I install the package control?

You can refer to the installation steps provided on the Package control website

(1) using [Ctrl + '] (or View > Show Console menu) to open the sublime text console, paste the following Python code into the console:

Import Urllib.request,os,hashlib; h =‘7183a2d3e96f11eeadd761d777e62404' +‘E330c659d4bb41d3bdf022e94cab3cd0‘; PF =‘Package Control.sublime-package‘; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); by = Urllib.request.urlopen ( ' http://packagecontrol.io/  "+ pf.replace (  ' 

This code creates the installed Packages folder for your (if necessary), and then downloads the package control.sublime -package into it.

Note: The above code will change depending on the version, so it is best to take the official "1" to copy the code.

(2) If not installed automatically, the official website "1" also provides a manual (Manual) installation method, specific practices can go to the official website reference

(3) If you see the package control item in Perferences->package settings, the installation is successful.

2.2.2 How to install plug-ins with the package control

1. Press Ctrl+shift+p to bring up the command panel.

2. Enter install to bring up the Install Package option and enter.

3. Select the plugin to install in the list, or enter the plug-in name (for example, to install the Imesupport plugin, enter Imesupport, it will filter the results in real time), according to the filter results in the command panel, choose the plug-in to install.

2.2.3 using the package control to view installed plugins

If you want to see what plug-ins are already installed in Sublime Text 3, you can do so in the following ways.

1. Press Ctrl+shift+p to bring up the command panel

2. Enter "Package" in the drop-down list to find "package control:list packages", select and enter, all the plug-ins will be displayed.

2.2.4 The path of the package control installation Plugin

So where are the plugins that were installed using the package control?

It is not placed under the ST3 installation path (e.g. I am installed in the Packages directory under the E disk: E:\Program files\sublime Text 3\packages). Open the C:\Users\ user name \appdata\roaming\sublime Text 3 directory, you can see there are 2 folders: Installed Packages and Packages. Only a single file (plug-in name. Sublime-package) plug-in, is placed in the installed packages directory, contains multiple files of the installation package plug-in (such as Converttoutf8,imesupport), was placed in the packages The directory.

When you download and install the plugin manually, you can place it in the corresponding directory depending on whether the plugin is a file or an installation package.

2.3 Shortcut keys

Mainly according to reference "2" in the content of the collation, thanks to the original author.

1. Settings

    • Ctrl + `: Open the Sublime text console
    • Ctrl + K, Ctrl + B: 组合键,Show or hide Sidebar
    • F11: Toggle Normal Fullscreen
    • Shift + F11: Toggle no interference fullscreen

2. Editing

    • Ctrl + Enter: Add a row below the current line and jump to that row
    • Ctrl + Shift + Enter: Adds a row above the current row and jumps to that row
    • Ctrl + ←/→: To move word by phrase,
    • Ctrl + Shift + ←/→: Make word-wise selection
    • Ctrl + ↑/↓: Move the current display area (just show the window changes, the file will not be modified)
    • Ctrl + Shift + ↑/↓: Move the current line (the file will be modified)

3. Select

    • Ctrl + D: Select the word where the current cursor is located and highlight all occurrences of the word, and Ctrl + D,会 select the next position where the word appears.
    • Ctrl + K: 在多重选词的过程中,会将当前选中的词To skip
    • Ctrl + U: 在多重选词的过程中,For fallback,
    • Esc: Exit multiple edits
    • Ctrl + Shift + L: Break the currently selected area and edit it at the same time
    • Ctrl + J: Merge the current selection into one row

4. Find

  • To Shift + ←/→ search for keywords that are used or Ctrl + D或鼠标 selected:
    • F3: Jump to keyword next occurrence position
    • Shift + F3: Jump to a location on a keyword
    • Alt + F3: Select all locations where the keyword appears (can be quickly replaced later)
  • Ctrl + F: Bring up the search box
    • Enter: Jump to the next position of the keyword
    • Shift + Enter: Jump to a location on a keyword
    • Alt + Enter: Select all the locations where the keywords appear (again, you can quickly replace them)
  • Ctrl + H: 调出替换框To replace
    • Ctrl + Shift + H: 输入替换内容后,Replace current keyword
    • Ctrl + Alt + Enter: 输入替换内容后,Replace all matched keywords. (Note: Notice that if the mouse focus is in the edit window, the replacement fails, the mouse focus is in the Replace box, Ctrl + Alt + ENTER does not work)
  • Ctrl + Shift + F: Turn on multi-file search & Replace
  • Alt + C: Toggle Case Sensitive (case-sensitive) mode
  • Alt + W: Toggle Whole Word matching (Whole matching) mode
  • Alt + R: Toggle regular Match mode on/off

5. Jump

  • Ctrl + P:
    • List the currently open file (or the file in the current folder), enter a file name, and then Enter  jump to the file
    • Combo Jump ("Go to Anything"): Ctrl + P after matching to a file, we can make subsequent input to jump to a more precise position
      • @Symbol Jump: Enter @symbol symbol the location where the symbol is located
      • #Keyword Jump: Enter #keyword the location to jump to keyword
      • :Line number jump: input :12 jump to the 12th line of the file
  • Ctrl + R: 
    • Lists the symbols in the current file (such as the class name and function name, but cannot drill down to the variable name), and Enter  you can jump to that place by entering the symbol name.
    • Outline of the markdown file is listed
  • F12: Quickly jumps to the definition of the symbol where the current cursor is located (jump to definition). For example, where the current cursor is a function call, F12 jumps to the definition of the function.
  • Ctrl + G: Enter line number to jump to the specified line

6. Window and tab page

    • Ctrl + N: Create a new label in the current window
    • Ctrl + Shift + N: Create a new window (this shortcut and Sogou Input Method shortcut key conflict)
    • Ctrl + W: Close the tab, if there is no tab, close the window
    • Ctrl + Shift + T: Restore the label just closed.

7. Split screen

    • Alt + Shift + 2: The left and right split screen
    • Alt + Shift + 8To split the screen up and down
    • Alt + Shift + 5Next to the left and right split screen (divided into four screens)
    • Ctrl + 数字键: Jump to a specific screen
    • Ctrl + Shift + 数字键: Moves the current screen to the specified screen

8. Formatting

    • Ctrl + [: Indent left
    • Ctrl + ]: Indent Right
    • Ctrl + Shift + V: You can paste the code in the current indent
    • Tab: Auto complement keyword

9. Brackets

    • Ctrl + M: You can quickly switch between the opening and closing parentheses
    • Ctrl + Shift + M: You can quickly select the content between parentheses
    • Ctrl + Shift + J: 对于缩进型语言(例如Python)可以快速选择相同缩进语句块的内容

Note:

1. Ctrl + Shift + F:  Open Multi-file search & Replace, this shortcut key and Sogou Input method of the simple shortcut keys have conflict, so when you can not adjust the search box, notice whether the current switch to the Sogou input method, if it is, switch to English input method, and then CTRL + Shift + F to call out.

2. Open Ctrl + Shift + F:  Multi-file Search & Replace, by default in the currently open files and folders to search/replace,

We can specify a search/Replace in the currently open file

2.4 Setting 2.4.1 Single user settings

1. Sublime Text 3 default settings file cannot be modified (Preferences/settings-default)

2. If you want to modify the configuration (such as font, etc.), you need to modify the User's configuration file (Preferences/settings-user), copy the following code into "2" "3"

{"Color_scheme": "Packages/color scheme-default/monokai.tmtheme", // set Courier new width font to read "Font_face": "Courier new", "font_size": 12.0, // make the cursor blink more softly "Caret_style": "Phase", // Highlight Current Line "Highlight_line": true, // Highlight modified label "Highlight_ Modified_tabs ": true," Ignored_packages ": [" Vintage " ]}      

Note: The added settings are placed in front of the following code, otherwise it will be an error; If you put it after the snippet, add a comma after the brackets.

    "Ignored_packages":    [        "Vintage"    ],  

3. If you want to set the TAB key and other code specifications, you can set the following "2"

    Set tab size to 4    "Tab_size": 4,    //use a space instead of tab    "Translate_tabs_to_spaces": true,    //Add row width ruler    " Rulers ": [+],    //display blank character    " Draw_white_space ":" All ",    //Save the end of the line automatically    " Trim_trailing_white_ Space_on_save ": True,    //save automatically add end of file wrap    " Ensure_newline_at_eof_on_save ": true,
2.4.2 Modifying the default profile location for sublime Text

1. After installing sublime text, the sublime text will generate a sublime Text 3 folder in the%appdata% directory for the configuration file and the various plugins installed later in the first run.

2. You can move this file to the sublime Text 3 installation directory for easy setup and packaging. So that at the same time in the company machine, home machine to ensure that 2 of the configuration can be synchronized. Specific settings can refer to "4"

2.4.3 Theme and color matching

1. How to install a Sublime Text theme?

There are 2 ways to do this:

(1) You can use the Colorsublime plugin to install the new theme (the easy).

Search for ' colorsublime ' in the package control and install the plugin. Installation steps, refer to "6"

Installation steps:

(2) Manual installation (the hard).

Refer to "5"

2. Install Colorsublime Plugin

There are 2 ways to:

(1) using the package Control (recommended)

Press Ctrl+shift+p to bring up the command panel, enter install to bring up the Install Package option and enter the plug-in name in the list colorsublime, select Plug-in installation.

(2) Manual Installation

Refer to "6"

3. Colorsublime Plugin Usage

(1) Press ctl+shift+p to open up Sublime Text ' s Command menu

(2) Select colorsublime:install Theme

(3) Use the arrow keys to run through the themes and see your current tab change in realtime!

3. Plugins

1. The Package Control

Plug-ins for managing plugins

2. Imesupport Plug-in

Sublime text support for Chinese input method has a small bug, that is, input in Chinese, input method can not be displayed in the Sublime text window, only in the Sublime text window, that is, "input box does not follow" "2"

Install the Imesupport plugin and restart sublime text.

3. ConvertToUTF8 Plug-in

Although it is possible to enter Chinese in ST3 and display it normally, ST3 will display garbled characters when opening a file that contains medium characters. Solve Chinese garbled problem, need to install ConvertToUTF8 plugin.

4. Htmlbeautify

formatting HTML

5. AutoPEP8

Format the Python code.

6. Alignment

For smart alignment.

7. Brackethighlighter

Highlight the matching brackets and the region where the current cursor is located.

References

"1" Package control:installation (https://sublime.wbond.net/installation)

"2" Sublime Text full Guide by Lucida (http://www.cnblogs.com/figure9/p/sublime-text-complete-guide.html)

"3" sublime text2 How to change the font? (http://jingyan.baidu.com/article/95c9d20d9d9f71ec4f756177.html)

"4" Build portable version Sublime Text2 (http://etosun.com/post/123)

"5" How to install a Sublime Text theme (http://colorsublime.com/how-to-install-a-theme)

"6" Colorsublime-plugin (Https://github.com/Colorsublime/Colorsublime-Plugin)

Sublime Text 3 Installation and use

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.