Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used commands for Vim cursor movement

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you about the Vim cursor movement commands commonly used in which the relevant knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you will learn something after reading this article, let's take a look at it.

Turn a page / half a page

For thousands of lines of text, if you want to move the cursor a few lines or turn the page to view, hjkl undoubtedly can not meet our needs, if we combine the CTRL key operation, it is very easy to turn the page.

CTRL+f: turn down one page CTRL+b: turn up one page CTRL+d: turn half a page down CTRL+u: turn half a page up

Of course, we only need to remember the four fbdu keys, anyway, they are used to combine the page turning function with the CTRL key. How to turn the page, you can remember it after several times of practice.

The length of the cursor one word at a time w: move to the beginning of the next word (w, which means word) W: move to the beginning of the next word

On the contrary, the two operations b and B

B: move to the beginning of the previous word B: move to the beginning of the previous word (the difference between b and B is the same as w and W) move the cursor within a line 0: move to the beginning of the line (number 0) $: move to the line not ^: move to the first non-empty character of the current line (if there is no space at the beginning of the line Then the effect is the same as 0) gallows: move to insert at the last non-white space character on the current line Append character I: insert character o: insert a new blank line down the current line O: insert a new blank line up the current line a: append the character R: replace the character of the current cursor until you exit insert mode (press ESC): r filename: insert the file named filename on the next line of the current line: r! Command: insert the result returned by command into the next line of the current line, copy a word, the beginning of the line, the end of the line, the whole line yw: copy the current word y0: copy the range from the current cursor to the beginning of the line yy: copy the current line nyy: copy line n from the current line (where n is a number)

After copying it, you can paste it with p.

Delete a word, the beginning of a line, the end of a line, the whole line x: delete the character dw at the current cursor: delete a word from the current cursor D0: delete the character from the cursor to the beginning of the line: delete the character dd from the cursor to the end of the line dd: delete the whole line ndd: delete n lines (also n represent numbers) above are all the contents of this article, "what are the common commands for moving the Vim cursor?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report