vi development shortcut key memo

one copy

    1 Copy a single line: move the cursor to the line to be copied, enter yy, move to the target position, and enter p.

    2 Copy multiple lines: use nyy instead of yy, for example, use 5yy for copying 5 lines

    3 Move: move the cursor to the starting position, enter ma, move the cursor to the end position, enter mb, then move to the position to be entered, enter mc, then: 'a,'bm 'c, if you want to copy, change m for co

    4 Copy across files, enter "a2yy (assuming 2 lines are entered) in the place where the first file is to be copied, move to another file, move the cursor to the target position, enter "ap

 

two format

   1 Press v for visual mode, use "j" to go down or "k" up to select multiple lines, press < or > to indent to format the indentation of the entire file: move the cursor to the beginning of the file, then press =G

   2 First get the start line number and end line number to be indented (such as start line 3 end line 9), then use 3,9> to increase the indentation of a tab to the right, 3,9 <indent to the left

 

Three jumps 1 On a word, you can directly jump to the next same word through *; 2 set incsearch or set is can be searched immediately when searching, that is, it can be displayed without entering the complete word to be searched; 3 set noincsearch or set nois cancel immediate search; 4 % make a jump corresponding to {} (); 5 { jump to a block; 6 gd go to the place where the variable defines;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326831194&siteId=291194637