1024programmer Linux Recommend two very useful vim plug-ins – quick positioning, pair editing-linux operation and maintenance

Recommend two very useful vim plug-ins – quick positioning, pair editing-linux operation and maintenance

Today I will introduce to you two very useful vim plug-ins, which can quickly move within the page and edit in pairs.

easymotion

We know that the vim editor can move up and down by pressing the keys h/j/k/l, use /keywords to search, use the keys w and e to move quickly between words, and use f{char} to Search within a line and more. However, none of these provide a way to quickly move within the entire page.

Today I will introduce a fast moving plug-in easymotion. With it, you can go wherever you want. The github address of the plug-in is: https://github.com/easymotion/vim-easymotion

Similarly, we use the vim-plug plug-in to install it. Then add a line of mapping to the configuration file

nmap ss (easymotion-s2)

Notice that what we need here is recursive mapping, not non-recursive map. After configuration, we can go to use it. The following demonstrates how to use it to complete the function of moving quickly on the page.

Now, we want to replace the double quotes in where on line 25 with single quotes, how to do it.

  • First move the cursor to any character in “”

  • Enter cs”'; cs (c means change), which means change the double quotes to single quotes

If you want to delete in pairs, delete the double quotes, and you should How to do it

  • Move the cursor to any character in “”

  • Enter ds”, d means delete

The double quotes have been deleted, but now you need to add double quotes, how should you do it

  • Move the cursor to i

  • Enter ysiw”

The above are recommended two very practical vim plug-ins – quick positioning, paired editing details, please pay attention to other related articles on 1024programmer.com for more!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/recommend-two-very-useful-vim-plug-ins-quick-positioning-pair-editing-linux-operation-and-maintenance/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索