In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Today I will introduce you to two very useful vim plug-ins that move quickly within the page and edit in pairs.
Easymotion
We know that the vim editor can move up and down by pressing the key h/j/k/l, using the / keyword to search, using the keys w and e to move quickly between words, using f {char} to search within the line, and so on. However, there is no way to move quickly throughout the page.
Today, we introduce a fast mobile plugin easymotion, which allows you to go wherever you want. The plug-in github address is: https://github.com/easymotion/vim-easymotion
Again, we installed it using the vim-plug plug-in. Then add a line of mapping to the configuration file
Nmap ss (easymotion-s2)
Notice that what we need here is a recursive mapping, not a non-recursive mapping. Once configured, we can use it. The following shows how to use it to complete the function of moving quickly on the page.
As shown in the figure, we want to quickly move to the layui position on line 9. If you don't use easymotion, you need to use vim with your own search. Type
/ layui
Then move up and down using nhammer N. If you use easymotion, it is easier and faster. Just press two ss and type la.
As you can see, the interface is different at this time, all the positions that match the la are marked in red, and each piece has its own corresponding letter. As long as we press the corresponding letter, we can quickly jump to the specified position.
Vim-surround
Usually work, will often encounter in pairs of editors in the case. For example, replace the single quotation marks of a string with double quotation marks. At this time, if there is no paired editing plug-in, it will be more troublesome and need to be modified twice to complete the requirements.
Now, let's install the plug-in first. The plug-in github address is https://github.com/tpope/vim-surround.
After the installation is complete, let's talk to you about how to use it, mainly from three aspects: pair modification, pair addition, pair deletion.
Now, we want to replace the double quotation marks in line 25 where with single quotation marks, what we need to do.
First move the cursor over any character in ""
Enter cs "'; cs (c for change) to change double quotation marks to single quotation marks
If you want to delete in pairs and delete double quotation marks, what should you do?
Move the cursor over any character in ""
Enter ds ", d for delete
Double quotation marks have been removed, but now we need to add double quotation marks. What should we do?
Move the cursor over I
Enter ysiw "
These are the recommended two very useful vim plug-ins-quick positioning, paired editing details, please pay attention to other related 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.