DEV Community

Discussion on: Automate typing with Vim macros

Collapse
 
iggredible profile image
Igor Irianto

Vlastimil got it covered.

Alternatively, there are other ways I would do to approach it. One is:

:put=range(1,3) 

This allows you to insert column of numbers. First do that, THEN insert the #s after. You can do multiple insert with:

  1. C-v,
  2. Select down several times,
  3. insert with I
  4. <Esc>

Another alternative is to have #'s and 0's first:

# 0
# 0
# 0

Using C-v, highlight ALL 0's only. Then g C-a to increment them.

Hope it helps!

Collapse
 
raguay profile image
Richard Guay

Thanks. I’ve been looking for this type of stuff. I’m Using Onivim2 entirely except for this one item that I need fairly often. There are so many ways to skin a cat! I’ve been trying to get a multiple cursor solution, but I can’t get them to work. These work great.

Thread Thread
 
iggredible profile image
Igor Irianto

You're welcome. That's why I like modal editor like Vim. You can get the same thing done in many ways depending on the user.

Btw, on the side note, I never heard of Onivim2 before. onivim.io/ - looks interesting 🤓. I've never heard of it before until you mentioned it. How did you find out about it and what do you think about it?

Thread Thread
 
raguay profile image
Richard Guay

I was looking for a vim graphical program because my MacVim kept crashing. I came across Onivim, the original one, and loved it. But, it kept crashing also due to changes in neovim. I then started to just use neovim in the terminal all the time (that’s when I found kitty, a better terminal). But, I kept up with development of Onivim. When Onivim 2 started in public alpha, I jump right on it and have been loving it.

But, I’m an editor collector. I’ve used Emacs (in evil mode using the Doom config), Vi, Vim, Sublime Text, Atom (crashes a lot), Visual Code, skEdit, Syntra, CotEdit, Lite, and MacVim (the latest version isn’t crashing as much).