vim text editor basic operation command Example

Today to introduce a text editor vim some basic commands and command instance.
·
This chapter describes
1, the basic concepts
2, three modes of basic operations

Description ----------- ------------ concept

Vim is a Vi similar to the famous and powerful, highly customizable text editor, improve and increase the number of features on the basis of Vi. VIM is a free software. Vim is generally regarded as the best type of editor Vi a fact true rival Emacs from different variants.

The role of the text editor
to create and modify text files
maintain Linux systems in a variety of configuration files

Linux most common text editor
vi: UNIX-like operating system default text editor
vim: vim is an enhanced version of the text editor vi
three modes vi editor
command mode: the default mode, the cursor moves, the shear / paste text (interface performance: the bottom left corner displays the file name or empty)
input modes: insert mode, press the ESC key to return: change the text (lower left corner of the display -INSERT- interface performance)
line mode: save and exit (interface performance : lower left corner shows -VISUAL-) press twice ESC key return line mode line mode
-
switching between different modes
vim text editor basic operation command Example

Basic operation command mode - Move the cursor

Action Type Operation keys Features
direction up down left right
Next page Page Down or Ctrl + F Flip up an entire page content
Page Up或Ctrl+B Flip up an entire page content
Quick Jump in the line Home key or "^", the number "0" Jump to the beginning of the line
End or "$" button Jump to the end of the line
Quick jump between the lines 1G or gg Jump to the first line of the file
G Jump to the end of the line in the file
#G Jump to the first line of the file #
Display line numbers : Not set Line numbers displayed in the editor
: set noun Line numbers displayed in the editor

The basic mode of operation commands - copy, paste, delete

vim text editor basic operation command Example

The basic operation command mode - Find the file contents
file contents Find
vim text editor basic operation command Example
command basic operations - Undo edit and save and exit
vim text editor basic operation command Example


The basic operation of the line mode - to save the file and launch the vi editor
vim text editor basic operation command Example

Line mode of basic operation - opening a new file or other file contents read
vim text editor basic operation command Example
line mode basic operation - replace file contents
vim text editor basic operation command Example

Guess you like

Origin blog.51cto.com/14307755/2430319