In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what are the skills for the use of vi/vim". The editor shows you the operation process through actual cases, the method of operation is simple and fast, and it is practical. I hope this article "what are the skills for the use of vi/vim" can help you solve the problem.
Common command editing
The following command is executed in command mode
Cw,dw: before and after the cursor, insert a character command at the top of the cursor: insert characters before and after the current line, insert a blank line at the front of the current line: change (replacement) / delete the word where the cursor is located (centering, changing, deleting, deleting) x, and delete the cursor, after deleting the cursor, after the cursor, the character cursor on the line moves up, down, left and right, respectively. Ctrl+b: turn the page down, up, n: type the number and enter, move the cursor back n lines nG: make the cursor jump to the specified line wGrady b: make the cursor jump forward or backward one word ma,mb,mc: move the cursor to the start line, end line, paste line w or W: move the cursor right one word to the prefix b or B: move the cursor left to the prefix e or E: move the cursor right one word to the suffix ( ): move the cursor to the beginning of the sentence, move the cursor to the end of the sentence {,}: move the cursor to the beginning of the paragraph, and end the cursor to the top line of the screen, the middle line The last line 0: (note is the number zero) the cursor moves to the beginning of the current line $: the cursor moves to the end of the current line to delete ndw or ndW: delete the word do at and after the cursor do: delete to the beginning of the line dashes: delete to the end of the line: delete the current line and then nmai 1 line x or X: delete a character, x after the cursor While X deletes the Ctrl+u before the cursor: delete the text entered in input mode, N1 abc N2 d: delete the content between N1 lines and N2 lines% d: delete all content 1 search / abc: search the end of the file from the beginning of the cursor abc?abc: search the head of the file from the beginning of the cursor\ / abc: search the end of the file from the beginning of the cursor / abc Where / is escaped n: repeat the previous search command N: repeat the previous search command in the opposite direction N: replace the last search command in the opposite direction replace the current line the first vivian is skys/vivian/sky/g: replace all vivian on the current line skyn,$s/vivian/sky/: replace the first vivian of each line from the nth line to the last line is skyn S/vivian/sky/g: replace each line from the beginning of line n to the last line where all vivian is sky%s/vivian/sky/g: (equivalent to g/vivian/s//sky/) replace each vivian of each line with skys#vivian/#sky/#: replace the first vivian/ of the current line with sky/ (you can use # or + as the delimiter S/p1/p2/g: replace all p1 in the current line with p2 in the current line, n2sqp1, p1 and p2max g: replace all p1 in lines N1 to N2 with p2 instead of g/p1/s//p2/g: replace all p1 in the file with p2, copy and paste yy: copy the current line nyy: copy the line at the beginning of the current line, press v first and then select the area with the arrow key. Press y to copy the selected line dd: cut the current line p (small): paste the contents below the current cursor. P (large): paste content N1 co N2 above the current cursor: copy the content between lines N1 to N2 to line N2 under line N2: move the content between lines N1 to N2 to the common option under line N2
Editor option
Set number: display line number set numbering: do not display line number, other options are added in the same way! Number set all: list all options setting set ignorance: ignore case set list in search: display tab stop (Ctrl+I) and line end flag ($) set warn: display NO write information if the current file is not saved when transferring to another file set nowrapscan: prohibit vi from starting from the other end of the file when the search reaches both ends of the file set mesg: allow vi to display information written to their terminals by other users using write
Editor Save
: wq: save and exit: Q!: do not save exit: W: save changes U: undo changes Ctrl+r: redo change recovery for undo this is the end of the content about "what are the tips for using vi/vim". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.