So this past week, I have been trying to learn something new. That new thing you may have heard of is called VIM, but if you haven’t I will explain below!
What’s VIM (or Vi)?
VIM (or Vi IMproved) is a text editor for basically every operating system out there including Windows, Mac, Linux, OS/2, BSD, and tons more including even mobile devices like Android even though that would be stupid. Why? Well because VIM is keyboard-driven! Everything is done with keyboard shortcuts and no mouse at all. Heck you don’t even use the arrow keys to move because they want you to be more efficient!
Why would you want to learn this?
Simply put, It makes you more efficient! Let’s walk though a few examples and you will see why!
First, say you have a piece of text that looks like this:
## LET'S DO IT! For today's entry, we have a simple setup by me based on [Manjaro Cup of Linux Edition (or mCOLe)][mCOLe] with a few tweaks! ![mCOLe](/images/oldposts/2015-01-18-hss-mCOLe/mCOLe-hss.png)
Maybe you want to replace
[Manjaro Cup of Linux Edition (or mCOLe)] with
something else but first you are still on the first line. This is simple to do
and will be way more efficient than using Notepad or other text editors.
- From the first line press
jto move down a line.
f[to “find” the first
ci[to “Change Inside Square Bracket”, this will delete the text and allow you to replace it with something new.
Escto exit Insert mode to return to editing.
Isn’t that simple? It seems a lot of work at first, but you can type it in a few seconds compared to fiddling with the mouse for 2 minutes trying to select only the items you want, then deleting them, then replacing them.
Modes? What are those?
You may have noticed that I mentioned something named Insert mode. This is why VIM (and Vi) are so different (and so confusing) to most people. Think of Insert mode as what you have now with Notepad or basically any other text editor. Normal mode is what you are in when you start VIM and this allows you to navigate text like we did above. There are more modes, but they are not used anywhere near as often.
Where can I try it?
vimtutorfrom the terminal on Linux/Mac or on Windows run
Vim tutorfrom the Start Menu. ↩︎