Full Screen text editor: Vim

Source: Internet
Author: User

Vi Visual Interface Bill JOY,S.U.N SPARC SunOS (Solaris)
Vim:vi improved
Modal Editor:
Edit mode (Command mode):----> Default mode of operation
Last-line mode:---->
Input mode (insert mode):---->
Replacement mode:---->
Visualization mode:---->
How to open ①vi/vim:
1. Vi/vim's interface
2.vim File:file exists, it opens and sets the cursor to the first character of the first line by default
File does not exist, it is opened as a new file and, if saved, is created: The file disappears if not saved
3. Vim +# File: Specifies that when the file is opened, the cursor is positioned at the beginning of the # line, and if the number of rows positioned is larger than the line of the entire document, the cursor rests at the beginning of the last line
4. Vim + file: Position the cursor directly at the beginning of the last line of the document
5. Vim +/pattern/: Opens the file and positions the cursor to the beginning of the line where the first PATTERN match is completed, that is, only the first match

②vim the way to close
Closing of the last line mode:
: Q Directly closes the Vim editor without saving changes
: q! Force quit but not save
: w Save the modified content
: Wq Save the modified content and close the Vim editor
: wq! For root, some read-only file modifications can be forced to save and exit
: w! Force Save
Closing of edit mode
ZZ Save and exit
ZQ Do not save exit

③ in Vim's edit mode, move the cursor
1. Character-by-word movement
(1.) ARROW
(2.) H: Cursor left
J: Cursor Down
K: Cursor Up
L: Cursor Right
2. Move Verbatim
W: Moves the cursor to the beginning of the next word (there is a space between the two words to calculate a word)
E: Move the cursor to the end of the next word
B: Move the cursor to the first word of the previous word
3. In-line jump
0: Absolute start: Position the cursor at the beginning of the line
^: Relative start: Position the cursor at the beginning of a non-whitespace character
$: Absolute end of line: hover the cursor at the end of the row
4. Jump between rows
#G: Move the cursor directly to the # line
G: Move the cursor directly to the last line of the document
GG: Move the cursor directly to the beginning of the first line
5. Cursor movement in the last line mode
: # Move cursor directly to # # line
: $ to move the cursor directly to the last line
: 1 Move the cursor directly to the first line
④ Flip Screen
Ctrl + F: flip one screen down
Ctrl + B: turn up one screen
Ctrl + D: Flip down half screen
Ctrl + u: Flip up half screen
⑤ character-by-word deletion
X: Delete a single character at the cursor location
X: Deletes a single character to the left of the cursor position
⑥ the Universal Delete command in edit mode
D: Delete all the contents of the cursor
DD: Delete cursor in the row
Dh,dj,dk,dl,darrow,dw,de,dgg,dg
In the last line mode:
: D: Delete cursor in the row
: #d: Delete Line #
: m,+nd: Delete all rows beginning with line m and on n rows
: m,nd: Delete all rows starting from line m to end of Nth line
.: Indicates that the cursor is currently in the row
$: Last line of document
., $: From the line where the cursor is to the last line of the document
⑦ the Universal Paste command in edit mode
P (lowercase): Paste right Down
P (uppercase): Paste left up
⑧ Universal Copy command in edit mode
Y: Copies all the contents of the cursor (using the same as the D command). )
YY: The copy cursor is in the row
Switching of ⑨ mode
1. From edit mode to last line mode:
: Enter command
and To find, N and n,n for search, N for reverse lookup
/: Top-down
? : Bottom-up
2. From last line mode to edit mode
ESC key
Enter key
Backspace key
3. From edit mode to input mode
I: Move the cursor to the beginning of the line into input mode
I: Insert information in front of cursor position
A: Move the cursor to the end of the line and enter the input mode
A: Insert a character after the cursor position
O: Insert a new row above the line where the cursor is located
o: Insert a new row below the line where the cursor is located
CC: Enter input mode after deleting entire line of content
C: Delete from the cursor position to the end of the line, enter the input mode
S: Delete the cursor at the location of a character, enter the input mode
S: Enter input mode after deleting entire line contents
4. From input mode to edit mode
ESC key
5. From edit mode to replacement mode
R: Enter replacement mode
6. From replacement mode to edit mode
ESC key
7. From edit mode to Visual mode
V: Rectangle selection by character
V: Select the rectangle in the behavior unit
You can perform a copy or delete operation after selection
Return to edit mode as soon as the operation is complete
All mode transitions must be in edit mode and cannot be toggled between two non-editing modes
⑩ Replace command
R: Replaces one character at the cursor position
⑩① Undo Edit Operation
U: Undo a previous edit operation
Ctrl + R: Undo the most recent undo operation
⑩② Repeat the previous edit operation
.: Repeat the previous edit operation
⑩③ Special last-line command
1. Display and cancel line numbering:
Set Nonumber---> Set nu (Suppress numbering)
Set Number--->: Set Nonu (show numbers)
2. Turn character case on or off:
: Set ignorecase--->: Set IC (Open)
: Set Noignorecase--->: set noic (OFF)
3. Turn the Auto Indent feature on or off:,
: Set Autoindet--->: set AI (Open)
: Set Noautoindet--->: set noai (OFF)
4. Turn on or off the find highlighting:
: Set Hlsearch (Open)
: Set Nohlsearch--->: noai (OFF)
5. Turn syntax coloring on or off
: Syntax on (open)
: Syntax off (off)
⑩④: Vimtutor
⑩⑤: Content Substitution


This article from "12443570" blog, declined reprint!

Full Screen text editor: Vim

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.