Linux-vim command (1)

What is the vim?

Vim is developed from a vi text editor. Easy programming code-completion, and compilation errors jumps, etc. is particularly rich, it is widely used among programmers.

Simply put, vi is an old-fashioned word processor, but functionality has been very complete, but still have a place to progress. vim can be said to be a procedural tool developers good use.

Even vim's official website ( http://www.vim.org ) has also said that vim is a program development tool rather than word processing software.

Vim is a highly configurable text editor for efficiently create and change any type of text. In most UNIX and Apple OS X systems, which are used as "vi" included
Vim steady as a rock, and is constantly evolving to get better. Features include:

  1. Lasting multilevel undo tree
  2. Extensible plug-in system
  3. Support hundreds of programming languages ​​and file formats
  4. Powerful search and replace
  5. Integration with many tools

vi / vim usage

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.

Simply put, we can think of these three modes under the icon:

 

Guess you like

Origin www.cnblogs.com/wangzn/p/12583678.html