In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What are the enhanced Vim editor commands, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
More than 20 useful commands can enhance your experience with Vim.
Note: the vi editor originally called the title and article has been updated to the correct name of the editor: Vim.
As a powerful editor with rich options, Vim is loved by many users. Describes some options that are not enabled by default in Vim but are actually very useful. Although it can be enabled separately in each Vim session, to create an efficient editing environment out of the box, it is recommended that you configure these commands in the Vim configuration file.
Preparation before starting
The options or configurations described here are located in the Vim startup configuration file .vimrc in the user's home directory. Follow the instructions below to set options in .vimrc:
(note: the vimrc file is also used for global configurations in Linux, such as / etc/vimrc or / etc/vim/vimrc. The .vimrc mentioned in this article refers to the .vimrc file located in the user's home directory. )
In Linux systems:
Open the .vimrc file with Vim: vim ~ / .vimrc
Copy the list of options for this article and paste it into the .vimrc file
Save and close (: wq)
(LCTT translation note: it is not recommended to use Vim to edit the .vimrc file here, as it is likely that the paste cannot be successfully pasted, you can choose a gedit editor to edit the .vimrc file. )
In Windows systems:
First, install gvim
Open gvim
Click Edit-> Startup Settings to open the _ vimrc file
Copy the "option list" of this article and paste it into the _ vimrc file
Click File-> Save
(LCTT translation note: you should be careful not to use the notepad that comes with Windows to edit the _ vimrc file, otherwise it may cause problems due to different line terminators. )
Next, we will delve into options to improve the efficiency of Vim editing. It is mainly divided into the following categories:
Hongmeng official Strategic Cooperation to build HarmonyOS Technology Community
Indent-Tab character
Show & format
Search
Browse & scroll
Spelling
Other options
1. Indent-Tab character
Causes Vim to use the same indentation as the previous line when creating a new row:
Set autoindent
Use smart indentation when creating new lines, mainly for programs such as the C language. In general, when you open smartindent, you should also open autoindent:
Set smartindent
Note: Vim is language-aware, and its default settings can be changed based on the programming language in the file to improve efficiency. There are many default configuration options, including axs cindent,cinoptions,indentexpr, which are not explained here. Syn is a very useful command for setting the syntax of a file to change the display mode.
(LCTT translation note: syn here refers to syntax, which can be used to set the programming language used by the file, turn on the corresponding syntax highlighting, and execute automatic events (autocmd). )
Sets the width of the tabs (TAB) in the file (expressed as the number of spaces):
Set tabstop=4
Set shift operation > > or
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.