In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "the use of vi and vim under Linux". In the daily operation, I believe that many people have doubts about the use of vi and vim under Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the use of vi and vim under Linux". Next, please follow the editor to study!
one。 A basic introduction to vi and vim
All linux systems will have a built-in vi text editor. Vim has the ability of program editing and can be seen as an enhanced version of vi. It can actively distinguish the correctness of syntax by font color and facilitate program design. Code completion, compilation and error jump and other convenient programming functions are particularly rich, which are widely used among programmers.
two。 Three modes commonly used in vi and vim 2.1 normal mode
Opening a document in vim goes directly to normal mode (the default). In this mode, you can use the up and down buttons to move the cursor, you can use Delete characters or Delete entire lines to process the contents of the file, or you can use copy and paste to process your file data
2.2 insert mode
Press any letter such as I, I, o, a, a, or R before entering editing mode. Generally speaking, press I.
2.3 Command Line Mode
In this mode, you can provide your relevant instructions to read, save, replace, leave vim, display line numbers, and so on.
three。 Mutual switching between vi and vim modes
Fourth, common shortcuts use command mode description yy editing mode copy current line 5yy editing mode copy current line down 5 lines p edit mode paste dd edit mode delete current line 5dd editing mode delete current line 5 lines down / command line mode enter "/" keyword, enter, enter n is to find the next one: set nu command line mode file is too long Set the file line number for easy viewing: set nonu command line mode cancels the file line number G general mode reaches the last line of the file gg general mode reaches the first line u general mode undoes shift+g general mode the first step is to set the line number, the second step is to enter the number of lines, and the third step is to enter shift+g
At this point, the study of "how to use vi and vim under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.