"Fe Front end learning" sublime turn on Vim mode

Source: Internet
Author: User
Tags sorts sublime text

Learning Goal: Open VIM mode under sublime to learn about basic Vim's editing shortcuts.

    • Download Install Sublime Text 3 : HTTP://WWW.SUBLIMETEXT.COM/3

Vim/vi:

Vim/vi is a text editor, no menus, only commands, suitable for writing front-end code. The efficient command line uses VIM to edit text, simply by working on the keyboard, without having to use the mouse at all.

To turn on Vim mode:

In the menu bar: Preferences-Setting-user, you can open the configuration file for editing, emptying the contents of the [] ignored_packages item:"Ignored_packages": []

Press ESC again to exit edit mode, which will enter Vim mode.

Operating mode:

Press ESC in any mode to enter command mode--is used to edit text, such as Page up and down, copy and paste, jump to the specified line and so on.

Press the A key again to enter edit (insert mode)--is used to write text content.

Cursor Movement:

Use the mouse to control the movement of the cursor, you need to execute the command mode "set Mouse=a" or "Set mouse=i" command, single-time effective, if you want to long-term effect, add the command to vim configuration file/ETC/VIM/VIMRC.

Keyboard pageup, PageDown key page, "Home" key to move the cursor to the beginning, "End" key to move the cursor to the end of the line, as well as the following table.

J Move down one line;
K Move up one line;

H move one character to the left;
L Move one character to the right;

Ctrl+b Move up one screen;
Ctrl+f Move down one screen;

Upward arrow moves upward;
downward arrow moves downward;
Left arrow moves left;
The right arrow moves to the right;

Quick positioning

: Set Nu Sets line number
: Set Nonu to go to line number

: Set nu! Suppress line numbers
GG to First line
G to last line
NG to Nth row
: N to Nth row

Find

F want to find after
F Forward Lookup

Copy and paste

P paste after the cursor;
Shift+p pasting before the cursor

Keyword completion

"CTRL + N" Sorts the list of matching keywords by the number of occurrences, while "ctrl+p" sorts the list of matching keywords by the distance from the current word.

File Save and exit

: w Save;
: w filename saved as filename;
: wq! Save exit;
: wq! FileName Note: The filename is saved and then exited;
: q! Do not save the exit;
: x should be saved and exited, function and: wq! same

Text deletion
x 一个字符;
#x 删除几个字符,#表示数字,比如3x;
dw 删除一个单词;
#dw 删除几个单词,#用数字表示,比如3dw表示删除三个单词;
dd 删除一行;
#dd 删除多个行,#代表数字,比如3dd 表示删除光标行及光标的下两行;
d$ 删除光标到行尾的内容;

J 清除光标所处的行与上一行之间的空格,把光标行和上一行接在一起;

So many shortcut keys, really annoying ah! I don't want to learn!! -There is such an idea that you can see the extended reading ↓.

(Refer to Vim edit mode "Personal Summary" I personally meticulously collected must be familiar with VIM shortcut operation Vi/vim Command mode and edit mode various operations)

(Expand to read the concise Vim training strategy)

"Fe Front end learning" sublime turn on Vim mode

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.