vim, vi operation

Substantially vi / vim divided into three modes, namely, command mode (MODE the Command) , the input mode (Insert mode) , and the bottom line command mode (MODE Last Line) . The role of these three models are:

Command mode:

Users just started vi / vim, then enter the command mode.

Keystrokes operation in this state is recognized as a command Vim, not input characters. For example, we then press the i, and does not enter a character, i is treated as a command.

The following are a few commonly used commands:

  • i  is switched to the input mode to input characters.
  • x  delete the character at the current cursor position.
  • :  Handover in the end line command mode to enter commands in the bottom row.

If you want to edit the text: start Vim, enter the command mode, press the i, switch to the input mode.

Command mode is only some basic commands, so the bottom line still rely on command mode enter more commands.

Input Mode

In the command mode by pressing i entered the input mode.

In input mode, the following keys:

  • Character keys and combinations of the Shift , enter characters
  • The ENTER , enter, line feed
  • SPACE the BACK , backspace, delete a character before the cursor
  • DEL , delete key, delete the cursor one character
  • Arrow keys , move the cursor in the text
  • The HOME / the END , move the cursor to the beginning / end of the line
  • Up Page / Page Down , up / page down
  • INSERT , move the cursor to an input / replace mode, the cursor will change to a vertical line / underline
  • The ESC , exit the input mode is switched to the command mode

Bottom line command mode

Press :( colon) in the command mode to enter the bottom line command mode.

Bottom Line Command Mode can enter commands single or a plurality of characters, a lot of available commands.

In the bottom line command mode, commands are basic (colon have been omitted):

  • q to exit the program
  • w Save the file

Press ESC at any time to exit the bottom line command mode.

 

1, jump to the specified line

In the command mode (Command mode), Input: n, representative of n-th row to jump, such as: 79, it jumps to the line 79.

 

2, the query

 

Guess you like

Origin www.cnblogs.com/zhanglw456/p/11655812.html