Easing into VIM

The other night, I watched one of Luke Smith's videos on VIM (embedded below) and got inspired. I've always been keyboard centric and been a fan of taking the time to learn keyboard shortcuts. And although I don't like the idea of abandoning my beautiful IDE for a text editor, I thought that adding some more macros to my life would only make it better.

This is what I've played with thus far. Installing the VIM plugin into Visual Studio Code lets me play around with it in controlled doses and let me use my editor as normal in vanilla mode when Vim comes to much. Vim mode is also supported in many of JetBrains' products, such as Rider.

First things first - once you've installed the plugin, to toggle it off, use the command palette and search for toggle vim. And once you've done it that first time, it's right there in recently used.


Now when we're operating in a safe environment, let's get some use out of the Vim macros! Things that caught my attention (and there are many more tips in the video below!), were

- ci"    to navigate forward on the line to the current set of quotes and change what's inside them to something else. What a super power! Also works with other characters, such as (, {, [. Also with that motion, you've copied the contents of the things inside the quotes to Vim's clipboard, which you can paste back with p.
- ESC u to undo. Though in VS Code, CTRL+z works too.
- zz    to zoom the line into the center of the screen, letting you focus on it. (zt for top, zb for bottom).
- CTRL+u to scroll up half a page, CTRL+d to scroll down.

On Linux, you have the vimtutor app (as explained in the video below). I also found this online resource to be helpful: https://www.openvim.com/



Comments

Popular posts from this blog

Auto Mapper and Record Types - will they blend?

Unit testing your Azure functions - part 2: Queues and Blobs

Testing WCF services with user credentials and binary endpoints