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 basic operations of VIM

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

Share

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

This article mainly explains "what are the basic operations of VIM". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the basic operations of VIM"?

Open the file:

$vim / etc/group or $vim:e / etc/group

Save the file:

W or: write # save the working file: W newfile.txt # save as file newfile.txt

Close the file:

X # Save the current file and then exit: wq # ditto: Q! # exit the basic mode of Vim directly without saving the file

If you can't successfully follow the steps above to open a file or save a file, congratulations, you need to understand the three modes of Vim before trying to use Vim.

0) normal mode:

After starting the vim program, by default enter the normal mode, in this mode, you can not modify the file, no matter what mode vim is in, as long as press the ESC key to return to the normal mode, if you are worried about ESC building did not press down, press more than the effect is the same. So what can be done in normal mode? You can move the cursor in normal mode, or enter another mode after entering the specified command.

1) insert mode:

If you want to modify the file as smoothly as a normal editor, you need to enter insert mode first, and then you can enter as many characters as you like. Enter the character'i' (I stands for insert, which is an insert command) in normal mode, and vim enters insert mode.

2) Command line mode:

This mode is used to execute commands at the bottom of the editor, such as performing the save operation wq, etc. How to enter the command line mode, enter a colon in the normal mode: it is the command line mode, in which you can execute various commands, such as save (: wq).

Cursor movement

Ordinary editor mobile cursor usually has a mouse or direction keys, but in the world of Vim there is no mouse, if you use the direction keys to control the cursor, then the speed is obviously too slow, in Vim there are four keys dedicated to cursor movement, they are hkjl.

H: move to the left j: move down k: move up l: move to the right thank you for your reading, these are the contents of "what are the basic operations of VIM". After the study of this article, I believe you have a deeper understanding of the basic operation of VIM, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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