I'm actually a well-adjusted Emacs user, which are few and far between. It's now been 4 years since I moved to New York and started using Emacs as my text editor for development. Here I'll go through parts of my impression so far about Emacs compared to Vim when used for programming, and some of my favorite extensions and parts of my configuration in Emacs.
When I think about opening a file in Vim, my muscle memory
hesitates for a moment - what if I need to open another
file? As a Vim user, I had used
NERDtree
to browse my directory tree and navigate through files. I
appreciate NERDtree's visual layout because I think of
myself as a visual person. The problem of opening files
and navigating between them can be solved in many ways, in
Vim and Emacs, and I've found that Vim's solutions often
involve random extensions, and it just feels less
orthogonal and well-designed than navigation in
Emacs. This is the main reason why I like using Emacs
when working on anything involving more than one
file. Using C-x C-f
opens the minibuffer that
allows you to type anything, has good tab completion, and
always works as expected.
The minibuffer
in Emacs is a central feature that I can't do without, for
now. From there I'll often split the window with C-x
3
or C-x 2
, and maybe switch one pane
to the the previous buffer with C-x b
. The
process is simpler and quicker than what I've found using
the :o
command in Vim. Notably, I no longer
rely on a perpetual visual directory layout, but always
have the option to open the directory with C-x
C-f
if I need to look around.
I believe that if you use a text editor, IDE or whatever, you should be able to use it with its default settings without that much inconvenience to your muscle memory. So like, the less crazy extensions and command customizations you have, the better.
An old co-worker,
when we were both learning Emacs, introduced me to the
Emacs extension that I still use the most:
window-number-mode.
Without window-number-mode
installed, I can
use the Emacs default C-x o
just fine. But I'll
admit that I have gotten used to switching between panes with
M-1
, M-2
, M-3
, etc.
Another customization I'll admit to using is a key shortcut to go to a specific line number:
(global-set-key (kbd "C-c g") 'goto-line)
And pretty often, I'll use
this abbrev
I've defined to insert a pdb breakpoint. Instead of typing
out the whole thing I'll just type pdb
.
(define-abbrev global-abbrev-table "pdb" "from ipdb import set_trace; set_trace()")
There are a few other extensions I regularly use, including whitespace-cleanup-mode and git-gutter. No doubt, extensions like this are available for Vim as well. But unlike Vim, Emacs has a built-in package manager.