backgroundAlthough I am an Android development engineer, I have also come into contact with various IDEs (not limited to Android development). Different IDEs often have different shortcut keys, and we can't configure every IDE. In fact, most IDEs now support Vim in the form of plug-ins. Therefore, you only need to master the basic use of Vim, and you can quickly get started in IDEs that support Vim, with familiar operations and familiar feel. Vim ModeVim can be divided into 3 modes: Normal mode, Visual mode and Insert mode. The following basic operations are all performed in Normal mode. The differences between the three modes are not explained in detail here. Bing search has many related basic tutorials. The relationship between the three can be simply described by the following figure Basic OperationCursor MovementPay attention to the difference between uppercase and lowercase letters Up, down, left, rightJust look at the table, it's simple and easy to understand. It may be a little awkward at first, but you will love it after getting used to it.
Inter-word positioningKey position If capitalized, words are allowed to contain punctuation w (jump forward to the beginning of a word) e (jump forward to the end of the word) b (jump back to the beginning of a word) Inline positioningKey position $ (position to the end of the line) 0 (position to the beginning of the line) ^ (position to the beginning of the line, ignoring spaces) fForward search for the character ch. If ch is a letter, it is case-sensitive. F Block positioningKey position {(jump to the previous code block) } (jump to the next code block) % (positions to another matching bracket) Page PositioningKey position gg (position to the first line of the page) G (position to the last line of the page) H (position to the top of the current page, High is capitalized) M (position to the middle of the current page, Middle is capitalized) L (position to the bottom of the current page, Low is capitalized) nG or ngg (position to the specified line, n represents the line number, must be greater than 0, if it is greater than the *** line number, it will jump directly to the *** line of the page) m and ' (this is a very powerful pair of commands that can mark a location and then quickly locate the mark on the same page. m means mark, a is a letter, which can be one of the 26 letters, and ' is a single quote followed by the previously marked letter) Screen scrollingFull screen scrollingKey position Ctrl + f (scroll down one screen, the first letter of Foward is lowercase) Ctrl + b (scroll up one screen, Backward has a lowercase first letter) Half screen scrollKey position Ctrl + d (scroll down half a screen, Down is lowercase) Ctrl + u (scroll up half a screen, Up is lowercase) Line ScrollingKey position Ctrl + e (scroll down one line) Ctrl + y (scroll up one line) Edit ModeinsertKey position i (insert at the cursor, the first letter of insert is lowercase) I (insert at the beginning of the line, the first letter of insert is capitalized) a (insert the character after the cursor, the first letter of append is lowercase) A (insert at the end of the line, the first letter of append is capitalized) o (insert in the previous row) O (Insert at the next row) cc/S (clear the current line and enter insert mode) s (clear the current character and enter insert mode) Well, this is very simple, so I won’t post a picture. FindKey position /pattern (forward search) ?pattern (reverse lookup) n (find next) N (Find Previous) * (When the cursor is on a word, search for the next word) # (When the cursor is on a word, search for the previous word) replaceKey position :%s/old/new/g (globally replace old with new) :s/old/new/g (replace the current line old with new) Note that the replace operation is only effective on the current page, so use this operation with caution. |
<<: Modify the default font globally, which can also be done through reflection
>>: Apple acquires French image recognition company, may embed technology into iPhone
As the largest overseas social platform, Facebook...
Information flow advertising is now the new favor...
Weibo's "Fanstong" is a marketing p...
In this era of information explosion, are you sti...
This year, the Hong Kong government will work with...
I believe that for the vast majority of companies...
After reading more than 30 marketing proposals ma...
In my past work experience, I have always been th...
The editor sent me a picture, and my fruit flies ...
There are three major dimensions for choosing a b...
The Tianxing gibbon was officially named by Chine...
On the topic of electric vehicles, the whole of E...
Today is Frost Descent, the eighteenth of the twe...
When it comes to Alfa Romeo, everyone will think ...
Part-time jobs and online earning are all opened ...