In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Vim copy cut and paste set line number skills, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Vim is a text editor developed from vi. Code completion, compilation and error jump are particularly rich in convenient programming functions, which are widely used among programmers, and Emacs has become the favorite text editor for users of Unix-like systems.
Vim's design philosophy is a combination of commands. Users have learned a variety of text-to-text move / jump commands and other normal mode editing commands, and if they are able to combine them flexibly, they can edit text more efficiently than editors without patterns. At the same time, VIM is similar to many shortcut key settings and regular expressions to aid memory. And vim is optimized for programmers.
Problem description:
Select the specified character in Vim, copy, cut, paste and set the line number.
Problem solving:
There are three ways to enter visual mode and visual mode in vim:
(1) in normal mode
Press v directly to enter the default visual mode, and you can use v+j/k/h/l for text selection
General visual
Note:
Use the v command in normal mode to enter visual mode, and v + j/k/h/l to select the text
Press the following keys for the selected text:
(1.1) d-Shearing operation
(1.2) y-copy operation
(1.3) p-paste operation
(1.4) ^-Select the current line and position the cursor at the beginning of the line (or use the home key of the keyboard)
(1.5) $- Select the current line and position the cursor at the end of the line (or use the end key of the keyboard)
(2) Visual Line mode
Press V to enter
After pressing V, enter Visual Line mode, and you can select one or more rows by using the JUnip k key.
(3) Visual Block mode
Press Ctrl + V to enter
After pressing Ctrl+V, enter Visual Block mode and use the j/k/h/l key to select a block.
Block mode
Note:
In block mode, you can modify multiple columns at the same time by:
First enter block mode Ctrl+ v
Use the key j/k/h/l to select multiple columns
Press Shift + I to insert in block mode
After entering the characters, press the key ESC to complete the insertion of multiple lines
In a nutshell:
Position the mouse to the start of the cut
Enter the v key to start selecting the cut character, or the V key is to select the entire line
Move the arrow keys to the end
The d key is cut and the y key is copied.
Move the mouse to the pasted location
The input P is pasted before the mouse position, and the input p key is pasted after the mouse position.
Vim sets line number
Temporary settin
Enter in vim
: set nu!
If the line number is displayed, its function is to cancel the line number; if the line number is not displayed, its function is to display the line number.
Fixed settin
Set it in ~ / .vimrc.
Add comments:
Double quotation marks are comments
"this is comments
Display the line number:
Add a line:
: set number
That's it.
After reading the above, have you mastered how to copy, cut and paste Vim to set the line number? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.