Hacker News new | ask | show | jobs
by jastanton 3979 days ago
Does anyone know if Vim has the power of multi line editing / multiple cursors like w/ Sublime Text? The large majority of my productivity involved copying and pasting with multi line select, and jumping words and different boundaries on multiple lines at once. Anything that matches ST for Vim?
4 comments

There is a plugin for that: https://github.com/terryma/vim-multiple-cursors

But I find that I can usually accomplish the same thing with macro or a targeted search and replace.

Vim does have the ability to insert text on multiple lines.

in visual block mode (CTRL-V or CTRL-Q), select a column of lines you would like to edit. Then, you can enter insert mode or paste and it will do the same thing on all the lines selected.

so to edit 4 lines at once it would be (CTRL-Q)3jI and then type in whatever i want and when I exit back to normal mode the text will appear on all 4 lines.

I think there does exist a way to enter a visual block mode, but i is kind of a pain. You might try looking around for some third party modules. Here is one I found by doing a github search: https://github.com/terryma/vim-multiple-cursors
An another alternative to the vim plugins, here's a vim-like text editor that concentrates on selections and multiple cursors: https://github.com/mawww/kakoune