SublimeText3 common shortcuts and excellent plugins

SublimeText is a front end marvel that drives fans crazy with its simplicity and DIY. All right, cut it out and get right to it.

The first is installation. If you have any software manager, just search it and install it with one click. Then, rich tyrants can buy one by themselves, and poor tyrants can search the registration code to see if there are tyrants to share.

Since it is a artifact, there must be something you don’t know is not, the following part is about operation. PS: part of the pictures and text from the network, here is only a little layout for easy access.

Test operating system: Win10 / Ubuntu 14.04 Test software version: SublimeText3 3059


SublimeText3 Operation section

1. Select the same item nearby:ctrl+d

Place the cursor over a word and press CTRL + D to select the word. Holding Down CTRL and pressing D multiple times selects the next match of the currently selected item. By holding Down CTRL and pressing D three more times, three identical texts will be selected.

2. Select all matches in the current file.alt+f3

Select all matches in the file. Use this with care, as it selects all matches in a file.

3. Select the package label for the text:ctrl+shift+`(The one under the ESC key)

This is a magic weapon. Maybe you want all the attributes to stay the same, but you just want to select the label. This shortcut does this for you and will notice that you can manipulate multiple tabs at once. Ps: The Emmet plugin is required.

4. Extend up one layer:ctrl+shift+a

If you place the cursor between the text and press the key above it will select the text, like CTRL + D. But pressing it again will select the parent container, and pressing it again will select the parent container. Ps: The Emmet plugin is required.

5. Select the contents in parentheses:ctrl+shift+m

This helps to select everything between the parentheses. The same applies to CSS.

6. Move the entire line up and down:CTRL + shift + writeorCTRL + shift + left

7. Copy rows or selected items:ctrl+shift+d

If you have selected text, it copies your selections. Otherwise, placing the cursor over the line copies the entire line.

8. Increase and decrease indentation:CTRL + [or]

9. Single-line clip or selected item:ctrl+x

10. Paste and copy format:ctrl+shift+v

11. Wrap a label around a line or selected item:alt+shift+w

12. Remove unclosed container elements:ctrl+shift+;

This removes the parent tag associated with your cursor. It’s great for clearing tags.

13. Uppercase and Lowercase: Uppercasectrl+k+uAnd lower casectrl+k+l

14. Comment the selected item/line:ctrl+/

This works in all languages, for both lines and selected items

15. Delete line:ctrl+shift+k

I don’t have to draw this one


SublimeText3 plugin section

First, install Package Control, SublimeText3 has been updated, SublimeText2 has been updated, note Ctrl+ ‘to open Console or View->Show Console menu to open command line

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
Copy the code

That’s it, and then you can install the plug-in

Download the package and drop it in the Preferences->Browse Packages folder. Then unzip and restart Sublime

1. emmet

There is nothing to be said for this, similar to jQuery syntax, the code is pushed up. However, it requires a PyV8 environment (you’ll see a folder after you install it), so it’s best to install it wire-free. CTRL + Shift +P enter install Package and wait for the server list to be read. Enter emmet

2. Sidebar enhancement plug-in sidebar Hslovakia

This also does not have what to say, who uses who knows, greatly enhances the right button list function, installs can use.

3. The console outgoing call plug-in Terminal

Use node, Grunt, etc to call out the console.

Tips: Shortcut CTRL + Shift +T to call out the console of the current file path

4. Code prompt plug-in SublimeCodeIntel

This is no nonsense, support multi-language high-speed coding code prompt tool. Once installed, it can’t be used directly, To configure it, click Preferences->Browse * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Config file configuration:

{
    "PHP": {
        "php": '/usr/bin/php',
        "phpExtraPaths": [],
        "phpConfigFile": 'php.ini'
    },
    "JavaScript": {
        "javascriptExtraPaths": []
    },
    "Perl": {
        "perl": "/usr/bin/perl",
        "perlExtraPaths": []
    },
    "Ruby": {
        "ruby": "/usr/bin/ruby",
        "rubyExtraPaths": []
    },
    "Python": {
        "python": '/usr/bin/python',
        "pythonExtraPaths": []
    },
    "Python3": {
        "python": '/usr/bin/python3',
        "pythonExtraPaths": []
    }
}
Copy the code

In fact, JS is enough, but you might want to write PHP someday, right? Keep it.

Then open Sublime and create a file to try. If that doesn’t work, press CTRL + Shift + Space to enable the prompt

5. Sublime-htmlprettify code layout plugin

What TAG, CssComb, JSFormat used to be, but one day they found a plug-in for prettify that integrates HTML, CSS, Javascript, and they didn’t change it

Tips: After installing the shortcut key CTRL + Shift + H to format the code

6. CSS3 prefix supplement plug-in Autoprefixer

CTRL + Shift +P type Install Package and wait for the server list to be read. Type autoprefixer and the first one is to install Node.js

Use method: Press Tab after entering CSS3 properties (before colon)


SublimeText3 adds right-click menu and shortcut to open browser

Add right-click menu

Sometimes I want to open a file and I want to open a SublimeText3, and I want to pull a file, so bother. Here’s how to add Sublime to the right-click menu.

  1. Open the registry,Start → Run →regedit
  2. inHKEY_CLASSSES_ROOT - * - ShellLet’s create a new entry calledSublimeText
  3. Right-click the SublimeText item and create a new string value calledIconThe value is “sublime_text.exe path,0”, for example:C:\Program Files\Sublime Text 3\sublime_text.exe,0
  4. Right-click SublimeText and create a new one. Name it command. The default value is “sublime_text.C:\Program Files\Sublime Text 3\sublime_text.exe %1

Once done, right click on any text file and try it. Do you see options for Sublime to open? Perfect

Browse files with one click

Preferences->Key Bindings – User Opens User shortcut Settings and copy the Settings below

[
    //firefox
    {
        "keys": ["f1"],
        "command": "side_bar_files_open_with",
        "args": {
            "paths": [],
            "application": "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
            "extensions": ".*"
        }
    },
    //chorme
    {
        "keys": ["f2"],
        "command": "side_bar_files_open_with",
        "args": {
            "paths": [],
            "application": "C:\\Users\\manfr\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
            "extensions": ".*"
        }
    },
    //IE
    {
        "keys": ["f3"],
        "command": "side_bar_files_open_with",
        "args": {
            "paths": [],
            "application": "C:\\Program Files\\Internet Explorer\\iexplore.exe",
            "extensions": ".*"
        }
    },
    //safari
    {
        "keys": ["f4"],
        "command": "side_bar_files_open_with",
        "args": {
            "paths": [],
            "application": "C:\\Program Files (x86)\\Safari\\Safari.exe",
            "extensions": ".*"
        }
    }
]
Copy the code

For a quick explanation, keys is the key and application is the browser application path. Note that the backslash should be escaped. Extensions match all file suffix formats.

Check the default shortcut keys, in SublimeText3 f1-F12, only F11 is set to full screen command by default, others are not set. That is, you can load ten or eight browsers in a row and click past test.


SublimeText3 problem section (self encountered)

1. Automatic updates

Sometimes the automatic update box will pop up, solution:

  1. Go to Preferences -> settings-user
  2. Add a sentence before the end of the last curly brace (“} “) :"update_check":false
  3. Then close Submine Text and restart it so that no update reminders will pop up again

Package Control: There are no packages available for installation

  1. CMD to inputping sublime.wbond.netCheck out the IP address for sublime.wbond.net
  2. Open theC:\Windows\system32\drivers\etc\hostsFile.

    Put an example at the end50.116.34.243 sublime.wbond.netSuch correspondence, IP is tested above
  3. Then close Submine Text and restart it so that no update reminders will pop up again

Reference:

Sublime does commonly used Text 3 front-end development good plug-in is introduced — Huang Yingkun Gif photos: I commonly used 16 Sublime does Text shortcuts | krypton


Add Ubuntu configuration (Supplement)

I’ve been playing Ubuntu lately, so I cut the environment over. Let me add a little bit here.

Install SublimeText3

The first thing to do is to install it. Try SublimeText2. The SublimeText3 installation package cannot be added to the installation package list. Attach a link to Ubuntu sublimeText 3-64bit: www.sublimetext.com/3

Install the node

The installation of the plugin is similar to the previous article, the only time is the installation of node (plug-in depends on the Node environment), do not know why the installation is good, input node -v always does not show the version, make a long time finally have no choice to Github under the node installation package.

Tips: Make sure node -v and NPM -v output the version number to indicate that the node installation is complete

With ubuntu installed node N method of post: www.linuxidc.com/Linux/2015-…

Browse files with one click

The browser installation directory is a bit different from Windows, see below:

[ //firefox { "keys": ["f1"], "command": "side_bar_files_open_with", "args": { "paths": [], "application": "/usr/lib/firefox/firefox", "extensions": ".*" } }, //chorme { "keys": ["f2"], "command": "side_bar_files_open_with", "args": { "paths": [], "application": "/opt/google/chrome/google-chrome", "extensions": ". * "}}]Copy the code

Firefox comes with Ubuntu, as shown above. Then Chrome is my own installation, basically should be this directory. Once installed, find a file and press F1 and F2 to check. In fact, I feel nothing, mainly because I am not familiar with some things in the Ubuntu system. I will strengthen it later. Thx ^_^