Vim’s Native Multiple Cursors Feature

Date: 2020/05/15
Categories: Tech
Tags: Vim

Sublime Text was my favourite text editor, I’ve been following it since its early days. The feature I most liked and can’t live without is the multiple cursors selection. Sublime Text lets you to select and edit string on multiple place at once based on pattern that you defined. I think it was a pain killer feature. The thing was that I always want to go back to Vim. The day I found this repository (https://github.com/terryma/vim-multiple-cursors), I switched back to Vim. vim-multiple-cursors is easy and intuitive as Sublime Text’s althought it’s a bit different in usage. But nowdays vim-multiple-cursors has been broken, especially on the latest Vim release.

I were wondering if there is a way to do the same things with Vim’s internal command. Tada yada thanks to https://vim.fandom.com/wiki/Vim_Tips_Wiki. Not very intuitive as Sublime Text’s or vim-multiple-cursors but it works as intended. Actually it is not a multiple cursors thing, still and all it achieved the same as multiple cursors feature. It’s more like a multiple replay.

Vertical multiple replay

Multiple replay by pattern

Update:

This repo showed up in vim-multiple-cursors’s issues (https://github.com/mg979/vim-visual-multi) and it works good too but I think I do stay on native Vim command so I don’t have to rely on my dotfiles for this feature.



>> Home