Sublime Installation
Sublime Text is a code editor. Sublime text was developed by the programmer Jon Skinner in January 2008 and was originally designed as a vim with extensive functionality.
Sublime text has a beautiful user interface and powerful features such as code thumbnails, Python plugins, code snippets, and more. You can also customize key bindings, menus, and toolbars. The main features of Sublime Text include: Spell checker, bookmarks, full Python API, Goto feature, instant item switching, multiple selection, multiple windows, and more. Sublime Text is a cross-platform editor that supports operating systems such as Windows, Linux, Mac os X.
Sublime text has the characteristics of small volume, fast running speed and so on.
Set right-click menu after installation
Start = Run = regedit = "Hkey_classes_root\*\shell\sublime2\command" to set the value to: "E:\Program Files (x86) \sublimetext_ 2.0.2.2221\sublime_text.exe "-P--remote-ab-silent"%1 "
Installing plugins
[Menu = = Preferences = Browse Packages], open [\sublimetext\data\packages] to copy the [Vintageex] plug-in package to the directory. In the [menu = Preferences = Settings-default = preferences.sublime-settings] file, replace the last line with the following: "Ignored_packages": [""]
Sublime Common settings Change the default mode
[Menu] = Preferences = Browse Packages = Vintage = preferences.sublime-settings] Modify file contents: ["Vintage_start_in_ Command_mode ": true]
Sublime closing the previous line number method
[Menu = Preferences = Settings-user = preferences.sublime-settings] Modify file contents: ["Line_numbers": false,]
Sublime Turn off auto-complete single-double quotes and parentheses and braces
[Menu = Preferences = Settings-user = preferences.sublime-settings] Modify file contents: ["auto_match_enabled": false,]
Sublime the way the background line of the current action line appears
[Menu = Preferences = Settings-user = preferences.sublime-settings] Modify file contents: ["Highlight_line": true,]
Sublime Close command Prompt
[Menu = Preferences = Settings-user = preferences.sublime-settings] Modify file contents: ["Auto_complete": false,]
Sublime Common function Code indentation
Press the V key and press the left and right to make the view selected for quick indent. When text is selected in command mode, visual is in view mode.
Right indent: [use ' >> ' in Tab],vim
Left indent: [Shift] + [use ' << ' in Tab],vim
Code comments
Single-line comment: [Ctrl] + [/]
Multiline comment: [Ctrl] + [Shift] + [/]
Vim mode
- Input mode
- Command mode
- Last-line mode
Enter command mode from input mode and last line mode with [ESC] key.
Command mode enters input mode
Command mode enters input mode |
I |
Insert from current cursor, enter input mode |
I |
Inserts into input mode at the first non-whitespace space currently in the row |
O |
Inserts a new line at the next line where the cursor is currently located, making the input mode |
O |
Inserts a new row in the previous line where the cursor is currently located, making input mode |
A |
Inserts at the next character where the cursor is currently located, making input mode |
A |
Inserts from the last character of the line where the cursor is located, making input mode |
S |
Remove current character into input mode |
S |
Delete current line into input mode |
Command mode
How to move the cursor |
h or LEFT ARROW key (←) |
The cursor moves one character to the left |
J or DOWN ARROW key (↓) |
Move the cursor down one character |
K or Up ARROW key (↑) |
Move the cursor up one character |
L or right ARROW key (→) |
The cursor moves one character to the right |
H |
The first character of the line that the cursor moves to the top of the screen |
M |
The first character of the line that the cursor moves to the center of the screen |
L |
The first character of the line that the cursor moves to the bottom of the screen |
G |
Move to the last line of this file (common) |
NG |
N is ' number '. Move to the nth row of this file. For example, 20G will move to line 20th of this file. |
Gg |
Move to the first line of this file, equivalent to 1G (common) |
0. ^ or function key [Home] |
This is the number ' 0 ': Move to the front of the line, 0 with spaces, ^ no spaces (common) |
$ or Function key [End] |
Move to the last face of this line prompt (common) |
N<space> |
That n means ' number ', for example 20. When you press the number and then press the SPACEBAR, the cursor moves the n characters of the line to the right. For example 20<space>, the cursor moves 20 character distances to the back. |
N<enter> |
N is a number. Move the cursor down n rows (common) |
Copy, paste, and delete |
X, X |
In one line of words, X is the backward deletion of a character (equivalent to the [Del] key), and X is to delete a character (equivalent to [backspace], which is the backspace) (common) |
Nx |
N is a number that continuously deletes n characters backwards. For example, I want to delete 10 characters consecutively, ' 10x '. |
Dd |
Delete the entire row where the cursor is located (common) |
Ndd |
N is a number. Delete the down n rows where the cursor is located, for example, 20DD to delete 20 rows (common) |
d1g |
Remove all data from the first row of the cursor |
Dg |
Delete all data from the last row of the cursor |
d$ |
Delete the last character of the row where the cursor is located |
D0 or d^ |
That is 0 of the number, delete the cursor where it is, to the first character of the line, d0 with spaces, d^ with no spaces |
Dw |
Delete a word, remove the character between the cursor and the next space |
Yy |
The row where the cursor is copied (common) |
Nyy |
N is ' number '. The next n rows where the cursor is copied, for example, 20yy copies 20 rows (common) |
y1g |
Copy all data from the row to the first row of the cursor |
YG |
Copy all data from the row of the cursor to the last row |
Y0 |
Copy all data from the same character as the cursor to the beginning of the line |
y$ |
Copy all data at the end of the line with the same character as the cursor |
P, p |
p to paste the copied data on the next line of the cursor, and p for a row on the cursor! For example, I currently have the cursor on line 20th and have copied 10 rows of data. When P is pressed, the 10 rows of data will be affixed to the original 20 lines, i.e. 21 lines. But what if we press P? Then the original 20th Guild was pushed into 30 rows. Common |
J |
Combines data from the row of the cursor and the next row into the same row |
C |
Repeatedly deleting multiple data, such as deleting 10 rows down, [10CJ] |
U |
Restores the previous action. Undo (Common) |
[Ctrl] + [Y] |
Redo Undo Operation |
. |
To repeat the meaning of a previous action. |
Search replacement |
/word |
Look under the cursor for a string called Word. Common |
? word |
Look for a string with the string name word on top of the cursor. |
N |
This n is the English key. Represents the action of repeating the previous search. |
N |
This N is the English key. In contrast to N, the previous search action for ' reverse '. |
R |
Single-character replacement |
: n1,n2s/word1/word2/g |
N1 and N2 are numbers. Look for the string word1 between N1 and N2, and replace the string with Word2! Common |
: 1, $s/word1/word2/g |
Look for the word1 string from the first line to the last line and replace the string with Word2! Same as ':%s/word1/word2/g ' (common) |
|
|
Last-line mode
: W |
Write the edited data to the hard drive archive (common) |
: Q |
Do not save exit |
: q! |
Force not save exit |
Wq |
To leave after storage, if: wq! After forcing the store to leave (common) |
X |
Save exit |
Sublime Text Editor + Vim plugin