Emacs vs Vim. Por que no los dos?
Emacs vs Vim. The holy war that has raged as far back as tabs vs spaces.
Which one is better?
From my own experience, there’s a few pros and cons each. Let’s do a quick recap. (I’m sure I’ll inflame both sides just by doing this 😂)
Vim
Pros:
- Virtually everywhere
- Fast
- Those fast and efficient keystrokes that translate
Cons:
- How do I exit this thing? Steep initial learning curve.
Emacs
Pros:
- So much features — I don’t need to leave emacs!
- Is that lisp?
Cons:
- Oh my pinky hurts!
- wtf????
This chart just sums it up:
I do think we can all agree on one thing:
If both editors are great why not combine the best of both worlds? Why not both?
Enter Spacemacs
Spacemacs is an abomination that combines the best of both worlds. Why not have the emacs features with those fast vim bindings?
The most common complaint about emacs is how your pink will hurt after using it all day. Our thumbs are more powerful than pinkies, why shouldn’t they be the leader key?
In Spacemacs, the space bar is your friend. It is the leader key that starts a command.
It’s also very easy to remember the hot keys because they are mnemonic.
- f= files
- w = window management
- b = buffer management
Here’s a few examples
Open up a new file with:
SPACE + f + f
Window management
# to split vertically
SPACE w /
# to split horizontally
SPACE w -
To move around to another window use vim (k=up, j=down, l=right, h=left)
SPACE w l
Once you are done with a window, you can close it with d
for delete
SPACE w d
To work with buffers:
- Go to the next buffer
SPACE b n
- Go to the previous buffer
SPACE b p
Master these keystrokes and you’ll be editing so much faster with your mighty thumb!
What about Visual Studio Code?
Ok fine, installing emacs isn’t for everyone. It’s also a pain to keep packages up to date, what if you just want to have the same experience for Visual Studio Code?
There’s an extension that mimics the keystrokes above. It’s the easy way out but it gets the job done.
At the end of the day these are just editors and they are tools for getting the job done. The choice is yours and hopefully you find these tips can make you productive.