In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Original link: Vim tutorial network-Vim cursor movement command summary
Introduction to Vim cursor movement commands, moving the vim cursor to the beginning of a line, line jump, vim matching words and matching parenthesis jump, Vim page turning commands.
I. Introduction to Vim cursor movement
Cursor movement commands in Vi/Vim are designed for different operation units, and different commands correspond to different operation units.
When executing the Vim cursor movement command, it is first necessary to distinguish which operation unit is used: a character, a sentence, a paragraph, a line, a screen, or a page.
After determining the unit of operation, you need to determine the number of times the command is repeated. The calculation formula for the operation object range of the Vim cursor movement command is:
Operating range = Number of operations x Operating unit
For example, the 5h command indicates a left shift of 5 characters, and the 8w command indicates a right shift of 8 words.
II. Vim Move Cursor Command 2.1 Up, Down, Left, Right
←h j↓ k↑ l→
Vim's up, down, left, right cursor commands are carefully designed, and the most common action we use when using the editor is to move the cursor down.
The j and k keys on the keyboard are the most convenient to use, so they are used as down and up cursors respectively.
h and l are located on both sides of j and k respectively, and are used to realize the left and right movement of the cursor according to their positions.
2.2 row-level shift
0 Move the cursor to the beginning of the current line
$Move cursor to end of current line
Move the cursor to the first non-empty character in the current line.
nG Move the cursor to line n of the current file
:n Move the cursor to line n of the current file (ditto)
tips:
(1)In Vim commands, 0 means the beginning of a line and $means the end of a line. You can recall the delete command mentioned in the Vim text editing command summary, which mentions 0 and $
(2)Move the cursor to the nth line of the current file using the command:n is executed in vim tail mode, so after entering:n, you need to press the Enter key to execute the command
2.3 file movement
gg or:0 Move cursor to first line of current file
GG or:$Move the cursor to the last line of the current line
2.4 word-level movement
w or W moves to the beginning of the next word
b or B moves to the beginning of the previous word
e or E moves to the end of the cursor word
W, B, E commands operate on words that are strings separated by white space characters (spaces, tabs)
For example, the string "str1-str2 str3-str4" is two words for W, B, E commands and four words for w, b, e commands
For more information about Vim words and strings, see the Vim tutorial website article Vim based on word movement and its Vim word and string concepts.
2.5 Match Word Level Move
* Move the cursor to [Match] the word next to the word in which the cursor is currently located
#Move the cursor to [Match] the word immediately above the current cursor
2.6 Match bracket move
% Move the cursor to the left half of the bracket (including (,{,[ ) corresponding to the right half match ( ),},] )
2.7 Paragraph-level movement
Move the cursor to the end of the paragraph
{Move cursor to beginning of current paragraph
2.8 Screen level movement
H Move the cursor to the first line of the screen
M Move the cursor to the middle line of the screen
L Move the cursor to the last line of the screen
2.9 page turning
Ctrl + f Scroll forward one page
Ctrl + b Scroll back one page
Ctrl + u Scroll forward half a page
Ctrl + d Scroll backward half a page
III. Linkage with other orders
Many commands can be linked to the vim cursor movement command summarized in the Vim tutorial network
The basic command mode is:
For example, the Vim command 0y$Split means: 0 Move the cursor to the beginning of the current line;y Copy;$End of the current line. So, the command 0y$means copying everything on the current row of the cursor
For example, the Vim command ye means copying from the current position to the last character of the current word.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.