Day 17: Vim Macros are Game Changers

As a VS Code user I must say that Vim Macros are the one thing that I whole heartedly am a fan of. They are smart, clean, and extremely powerful. All Vim fanatics should honestely just lead with Macros whenever they try to make their case for why it’s the best.

TLDR;

Okay, so here are the highlights of what I did:

  • I learned how to use Vim macros and practiced using them to steamline some tasks that I was previously doing manually.
  • I read through the sample .vimrc (Vim configuration file) provided by the MIT Course. I also figured out where it’s best to store config files, since the instructions were for Linux/Mac computers and I’m on a Linux.
  • I practiced using Vim some more outside of the VS Code emulated version and it’s not so bad. I still need to learn how to open multiple windows but I’m getting there slowly.

Vim Progress

Like I said, Macros are something else!! If you are not familiar with them, here is a quick breakdown. Macros allow the user to record all the keys being pressed and to repeat them later on wherever they want within the file. Imagine having to perform the same complex edit in multiple locations because of some reformatting requirement or design standard change. Well now that can be streamlined and done once. Here’s a solid video on Macros .

The User Home Directory on Windows

Basically, the .vimrc file needed to be saved in the user’s home directory. I wasn’t sure where that would be on a Windows PC since the file system is structured differently. Turns out that the ‘Home’ directory corresponds to my /c/Users/Jamal\ Ahmed/ directory. So /c/Users/username/ is the format for the home directory which in many shell is represented by the ~ key.

# Home directory might look like this in your terminal
~/ $

Conclusion

That’s all for today. If you are interested in the MIT course you can check out the video lecture I’m currently going through. The lecture is helpful but isn’t sufficient by itself. Anyways, until next time PEACE!