Sublime shortcut keys

Source: Internet
Author: User

After I did a demo containing some live coding, some viewers asked me how I operated so quickly. Of course there is no single answer, the answer is a bunch of simple shortcuts and a lot of practice combinations. In response to those queries, I felt it necessary to look at the shortcut keys I didn't want to think about and use every day.

Here's a featured list of 16 shortcuts (a custom shortcut), animated in GIF, which I use every day. Enjoy it!

(Translator Note: The original list of shortcut keys are OS X environment, in order to facilitate the Windows and Linux environment Child shoes Learning, the translator will note Windows and Linux corresponding shortcut keys)

Choose
    • Select the next occurrence of a selected item
    • Select all occurrences of a selected item
    • Select the start and end tags associated with the cursor
    • Select contents in container (new)
    • Select the contents in parentheses
Moving lines and text
    • Move Up or down
    • Copy rows or selected items
    • Increase and Decrease Indent
Cut and delete, copy and paste
    • Cut Rows or selected items
    • Paste and keep indent
    • Wrap rows or select items with labels
    • Remove the unclosed Container element
Text and number manipulation
    • Calculating mathematical expressions
    • Increment and decrement
    • Uppercase and lowercase
Annotation and alignment variables
    • Note Checked items/rows
    • Aligntab Customizing shortcut keys

Select the next occurrence of a selected item:? + D

(Translator note: ctrl+d)

Put the cursor on a word, press? + D, the word will be selected. Keep holding down? and press D multiple times, the next occurrence of the currently selected item is selected. By holding down and pressing D three times, the three identical text will be selected.

Select all occurrences of a selected item: CTRL +? + G

(Translator Note:alt+f3)

Same as above, but it selects all occurrences in the file. Be careful with this, because it selects all occurrences of a file. .

Select the start and end tags associated with the cursor:? +?+ K

(Translator Note: ctrl+shift+ ')

This is a magic weapon. Perhaps you want all the properties to remain the same, but just want to select the label. This shortcut key for you to do this will notice that you can manipulate multiple tabs at once. * Requires Emmet plugin

Select contents in container: CTRL + D

(Translator note: ctrl+shift+a)

If you place the cursor between the text and press the key above, the text will be selected, like? + D. But press it again, select the parent container, and then press to select the parent container. * Requires Emmet plugin

Select the content in parentheses:? + ? + Space

(Translator Note:ctrl+shift+m)

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

Move up or down: CTRL +? +↑ or ↓

(Translator Note:ctrl+shift+ or )

Copy rows or selected items:? + ? + D

(Translator Note:ctrl+shift+d) If you have selected the text, it will copy your selected items. Otherwise, placing the cursor on the line will copy the entire row.

Increase and Decrease Indent:? + [or]

(Translator Note:Ctrl +[ or ])

Cut rows or selected items:? + X

(Translator Note:ctrl+x)

Cut one line to your clipboard and you can paste it elsewhere.

Paste and keep indent:? + ? + V

(Translator Note:ctrl+shift+v) This is another shortcut that I use every time. In GIF I show the contrast between the two effects of normal paste (? + V) and indent paste. Notice how the indentation is arranged.

Wrap lines with labels or select items: CTRL +? + W

(Translator Note:alt+shift+w)

Wrapping a line with a label; Start typing the tags you want to use and you're successful.

To remove an unclosed container element:? +

(Translator Note:ctrl+shift+; This will remove the parent tag associated with your cursor. It is helpful to clear the tag.

Calculate mathematical expression:? + ? + Y

(Translator Note:ctrl+shift+y) I never thought I would use this a lot, but it really works.

Increment and decrement:? + option +↑or↓, option +↑or↓

(Translator Note:alt+shift+ or ↓,Ctrl + or )

Press and hold ? the number will be changed in 10 increments, without holding the 1 step. Also note that you do not need to select numbers, Sublime Text is smart enough to update the bank's recent figures.

Uppercase and lowercase:? + K then U,? + K then L

(Translator Note:ctrl+k+u,ctrl+k+l)

Note Select item/row:? + /

(Translator Note:ctrl+/)

This is available in all languages and is available for both rows and selected items.

Extra delightful thing! Use Aligntab to customize shortcut keys

The shortcut keys above are sublime text default shortcuts, but you can also add your own custom shortcut keys. The following example applies the Aligntab plug-in using three custom key bindings to align content vertically based on = =, and:. Because I work primarily with JavaScript and PHP, these bindings are useful for almost every scene I need, but you can align vertically with any character you want.

In your own editor implement the GIF effect below, just install Aligntab, add custom bindings to your custom key binding file, select some code, and click CTRL + ? + . or ; =.

Conclusion

Once you see a change in multiple lines of code, there is usually a way to implement the change using a few keys instead of editing them one by one. By continuously using the combination of the above shortcut keys to perform repetitive or predictable changes, you can greatly increase the speed of your coding.

Here is a short gif that includes selecting all occurrences, copying the linked text, pasting the copied text with a multiline cursor, and converting the text to lowercase.

Sublime Text 3 is very practical, but want to use good, some shortcut keys are indispensable, so turn this shortcut key summary.

Used to use Vim, some shortcuts are too lazy to use, especially under win, there is a graphical interface, so personally feel the most useful or search class, for reading and modify code, very practical.

Select Class

  • Ctrl+d selects the text that the cursor occupies, and continues, the next identical text is selected.
  • Alt+f3 selected text Press the shortcut key, you can select all the same text at once to edit simultaneously. Give a chestnut: quickly select and change all the same variable names, function names, and so on.
  • Ctrl+l Select the entire row, continue to select the next row, the effect is the same as the shift+↓ effect.
  • Ctrl+shift+l Select multiple rows First, and then press the shortcut key to insert the cursor at the end of each line to edit the rows at the same time.
  • Ctrl+shift+m Select the contents in parentheses (continue to select the parent bracket). Give me a chestnut: Quickly select the code in the delete function, rewrite the function body code, or rewrite the contents of the parentheses inside.
  • CTRL+M cursor moves to the end or start position within the parentheses.
  • Ctrl+enter inserts a new row in the next line. For a chestnut: even if the cursor is not at the end of the line, you can quickly insert a line down.
  • Ctrl+shift+enter inserts a new row in the previous line. For a chestnut: even if the cursor is not at the beginning of the line, it can be inserted quickly.
  • ctrl+shift+[Select the code, press the shortcut key, and collapse the code.
  • ctrl+shift+] Select the code, press the shortcut key, and expand the code.
  • Ctrl+k+0 expands all collapsed code.
  • ctrl+← move the cursor to the left and move the cursor quickly.
  • ctrl+→ move the cursor to the right and move the cursor quickly.
  • Shift+↑ select multiple rows upwards.
  • Shift+↓ Select multiple rows.
  • shift+← Select the text to the left.
  • shift+→ Select the text to the right.
  • ctrl+shift+← Select the text to the left of the unit.
  • ctrl+shift+→ Select the text to the right of the unit.
  • Ctrl+shift+↑ swaps the cursor line and the previous line of code (before inserting the row of the cursor into the previous row).
  • Ctrl+shift+↓ swaps the lines of the cursor and the next line of code (inserts the row of the cursor after the next line).
  • Ctrl+alt+↑ Add a multiline cursor up, and you can edit multiple lines at the same time.
  • Ctrl+alt+↓ adds a multiline cursor down to edit multiple lines at the same time.



Edit Class
    • Ctrl+j Merge the selected lines of code to one line. For a chestnut: merge the CSS properties of the multiline format into one line.
    • Ctrl+shift+d the entire line where the cursor is copied, and inserts it into the next row.
    • Tab right indent.
    • Shift+tab indents to the left.
    • Ctrl+k+k removes code from the cursor at the end of the line.
    • Ctrl+shift+k Delete the entire row.
    • ctrl+/Comment Line.
    • ctrl+shift+/comment Multiple lines.
    • Ctrl+k+u convert uppercase.
    • Ctrl+k+l convert lowercase.
    • CTRL + Z undo.
    • Ctrl+y restore Undo.
    • Ctrl+u soft undo, feeling and gtrl+z the same.
    • CTRL+F2 setting bookmarks
    • Ctrl+t around the letter interchange.
    • F6 Word detection spelling



Search class
    • Ctrl+f Open the bottom search box to find keywords.
    • Ctrl+shift+f in folders, unlike the normal editor is sublime allow to add multiple folders to find, slightly high-end, not researched.
    • Ctrl+p Open the Search box. For a chestnut: 1. Enter the file name in the current project, quickly search for files, 2, enter @ and keywords, find the function name in the file, 3, enter: And number, jump to the line code in the file, 4, enter # and keyword, find the variable name.
    • Ctrl+g Open the Search box and automatically take:, enter a number to jump to that line of code. For a chestnut: Quickly locate a file in which the page code is relatively long.
    • Ctrl+r Open the Search box, automatically with @, enter keywords, find the function name in the file. For a chestnut: Quickly find a function on a page with more functions.
    • CTRL +: Open the search box, automatically with #, enter keywords, find variable names in the file, attribute names, and so on.
    • Ctrl+shift+p Open the Command box. Scene Chestnut: Open the Name box, enter the keyword, call sublime text or plug-in features, such as using the package installation plugin.
    • ESC exits the cursor multi-line selection, exits the search box, command box, and so on.



Display class
      • Ctrl+tab Toggles the tab of the current window in the order in which the files were browsed.
      • Ctrl+pagedown Toggles the tab of the current window to the left.
      • Ctrl+pageup Toggles the tab of the current window to the right.
      • alt+shift+1 window split screen, restore the default 1 screen (non-keypad number)
      • Alt+shift+2 left and right split screen-2 columns
      • Alt+shift+3 left and right split screen-3 columns
      • Alt+shift+4 left and right split screen-4 columns
      • Alt+shift+5 4 Screen
      • Alt+shift+8 Vertical Split Screen-2 screen
      • Alt+shift+9 Vertical Split Screen-3 screen
      • Ctrl+k+b Toggle the sidebar on/off.
      • F11 Full Screen mode
      • SHIFT+F11 free-to-disturb mode

Sublime shortcut keys

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.