DEV Community

Discussion on: Exploring Vim

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

This was awesome. Thanks for posting.

Now I need to plug Atom's vim-mode-plus, specifically, it's incredible occurrence operators:

d o i l delete occurrence in line - deletes all instances of the current word in line
c o i l change occurrence in line - changes all instances of the current word in line
c o i p change occurrence in paragraph - changes all instances of the current word in the paragraph - perfect for refactoring the name of a function param
c o i p change occurrence in paragraph - changes all instances of the current word in the paragraph - perfect for refactoring the name of a function param

And even more. I'm so completely hooked on these workflows because they're so nice.

I also added some vim/emmet crossover keymappings, like

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'g e r t':  'emmet:remove-tag'

That one's clutch:

<a href="#"><p⌨️re><code>Bar</code></pre></a>

With cursor at ⌨️, I escape to normal mode and hit g e r t and voila - I get

<a href="#"><code>Bar</code></pre></a>

I'm so hooked on VIM, I even baked simple commands into my keyboard's firmware. It's a little buggy, but you're free to use it, and if you're interested, PR's are welcome ;)

Collapse
 
vintharas profile image
Jaime González García

Thank you! And thank you for the comment!

I really like the occurrence operator. It feels very convenient! Like a shortcut for the vim substitute command that plugs in as a text object with all other commands. I'm not fluent enough in vimscript yet but it sounds like something that could be implemented as a vim plugin :D