Linux vim editor used in three modes commonly used commands and

Linux will be frequently used commands by heart

Command-line mode:

  Move the cursor:

  Left and right arrow to move the cursor down;

  Move the cursor to the end of the line: $;

  Move the cursor to the first line: ^;

  Move the cursor to the end of the page: shift + g;

  Move the cursor to the header: 1 + shift + g;

  Moved to the target line: n + shift + g;

  To quickly move the cursor around: ctrl + ← / → key;

  Left or right by n characters: n + ← / → key;

-----------------------

  delete:

  Delete cursor line: dd;

  Remove the cursor after the row n-1 and the row: dnd;

  To delete a letter: x (equivalent to del);

  To delete a letter: X (the equivalent of backspace);

  To delete a word: dw; (preferably on the first letter of the word)

  Undo the last step: u;

----------------------

  Moving words:

  Moved to the right a word: w;

  Move one word: b;

----------------------

  copy and paste:

  Copy the line in the current cursor location: yy;

  Objective line arrow to paste: p;

  Copy the current cursor row n-1 and subsequent row: yny;

  Copy a word: yw;

-----------------------

  Cut:

  Cut the current cursor position to the end of the line: d + shift + 4 / d + $;

  Cut the current cursor position to the first line: d + shift + 6 / d + ^;

  

Edit mode:

  Enter command-line mode edit mode, pressing i, I, a, A, o, O, r, R to enter the edit mode, press the general direct line i;

  i is the current cursor before editing, a is in the current editing cursor, o is edited in the next line of the cursor;

  Exit edit mode enter the command line mode to press esc.

 

Line mode:

  Line mode command line mode to enter the way:

    1.

   2 lookup / + word is searched, n is the next, shift + n refers to one;

    3. Look, + the word being sought, n is one, shift + n is next?;

  Save instruction: w;

  Save command: w file name;

  Exit instruction: q;

  Save and Exit command: wq;

  Forced to quit without saving instructions: q !;

  Alternatively:% s / old / new / g;

  No display line: set nu;

 

to sum up:

        Press the keyboard key -------- --------- i> input mode (press the Esc key to return to command mode)   
            |               
      command mode
            |

            ----------- type ":" ------> line mode (press the Esc key to return to command mode) 

  The main function of the three modes:

  Command mode: copy, paste, delete, move the cursor to find

  Edit mode: Edit Text

  Line mode: save, quit, Replace, Find

  

 

  

 

Guess you like

Origin www.cnblogs.com/wsxdev/p/11546217.html