Vim Editor Detailed

Source: Internet
Author: User

Vim is a modal full-screen editor:

The following three modes are available:

Command mode: Typed characters as command processing instead of typing directly into the document

Input mode: Typed characters are entered directly into the document

Last-line mode: characters typed as delimiters and commands to manipulate text can accomplish more complex operations than command mode.

Converting from command mode to input mode

I: Convert to input mode in front of cursor position

I: Convert to input mode at the beginning of the line where the cursor is located

A: Convert to input mode after cursor position

A: The line at the end of the line at the cursor is converted to input mode

O: The next line in the row where the cursor is located is converted to input mode

O: Convert to input mode on the previous line in the row where the cursor is located

To convert from command mode to last-line mode:

In the command mode type: (colon), the editor does appear below: (colon)

From last line mode, input mode to command mode:

Press the ESC key at the top left of the keyboard to

Commands that can be used in command line mode:

Character Jump command:

W: Jump to the beginning of the next word

E: Jumps to the ending of the word where the cursor is located or the ending of the next word

B: Jumps to the beginning of the previous word

H: Move one character to the left

L: Move one character to the right

J: Move Down one line

K: Move up one line

Text Manipulation Commands:

D: Delete command, you can use the character jump command

#dw, #de, #db等

D: Delete the content at the end of the line where the current cursor is located

Y: Copy command, can be used with the character jump command

#yw, #ye, #yb等

#yy: Copy the current cursor starts with a total of # lines

C: Replace command, can be used with the character jump command

#cw, #ce, #cy等

#cc: Replace the current cursor starting with a total of # lines

C: Replace the content from the current cursor to the end of the line

p| P: Pastes the contents of the buffer to the specified position

#u: Undo Last # operation

Ctrl+r: Undo Last Undo Operation

At the same time, press and hold Ctrl+w, then press S: Vertical split screen Current window

Press and hold CTRL + V to release, and then click S: Horizontal split screen Current window

Last-line mode can command the use of specifications

addresscommand[command modifier]

Address character:

. (dot): Indicates that the cursor is in the row

$: Indicates the last line of the file

+#: Indicates the bottom # line from the beginning of the cursor

$-#: Indicates the penultimate line #-1

%: Full text

Command: Here you can use the single-character text manipulation commands {(p| P) and Ctrl+r except}

You can also use the%[email protected]@ @gi command to make text substitutions

Set Nu: Display line number

Set IC: Ignore character case

Set AI: Setting auto Indent

Set Hlsearch: Setting Search highlighting

Turn off the above features:

Set Nocommand

Syntax On|off: Turn syntax highlighting on or off

Vim's options:

+#: Indicates that the open file is skipped directly to line #

-O file1 file2 ... : Open multiple files on vertical split screen

-O file1 file2 ... : Open multiple files on horizontal split screen

Configuration file for vim command:

/ETC/VIMRC: global scope in effect

~/.VIMRC: Current user is in effect

This article is from "Chalet Technology" blog, please make sure to keep this source http://starli.blog.51cto.com/8813574/1657648

Vim Editor Detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.