In my previous post, I talked about the way I tended to integrate everything in Emacs. In this one, I want to describe what lead me to totally change the way I use it.
Living in the terminal
I just spend four months in front of my computer. I literally lived inside my
terminal for various reasons. I had biological data to analyse, and software to
develop to do it. I used R
, bash
, perl
and Python
and read some C
code
too. The diversity of languages we have to face when working in the
bioinformatics field is incredible. For that I was lucky to have chosen to learn
polyglot vi
and emacs
in the past. Not being locked to a particuliar IDE
when facing that much diversity is a great thing.
Developping inside emacs
At the beginning, I was doing exactly what I described in my previous post. I
lived inside org-mode, using code blocks to put up software and describe what
each piece of code was doing. I then tangled each block to its file, tested it,
went back to org-mode, debugged it, tangled it, tested it … At the end of the
day, that makes a lot of C-u C-u C-c C-v
t
1
I had to speed up the way I wrote software, particularly when I was facing very
tight deadlines. I really gradually started not to use org-mode to organise
source code. Then I was not using it at all. Even my TODO notes migrated to
taskwarrior, a great command line tool with very
similar abilities as org-mode. The only benefit it has is being accessible from
the command line really fast. Just type alias T='task'
and T
to have a brief
overview of what’s to be done.
Then I (re)learned to use tmux, and started to harness the emacs daemon feature. It boosted my productivity a great deal. Just add
export EDITOR="emacsclient -t"
export ALTERNATE_EDITOR=""
alias e='emacsclient -t'
to your .bashrc
2, and you’re all
set to use emacs as your main editor. You can have as many tmux sessions you
want, there is only one emacs instance to edit all the file you edit. It makes
integrating emacs and the typical terminal environment, with all its speed and
comfort, really nicer.
I recommend it to everyone searching for a way to integrate emacs within its
terminal. I remember being very destabilized when I quit vim to emacs by the
fact that emacs was really slow to open a simple file. I ended up using only the
graphical emacs, but had to switch between emacs and the terminal quite often.
To be honest, the shell
, ansiterm
, eshell
and all are not that great for
now inside emacs. It feels very clumsy and slow, and result in all sort of bugs
when emacs tries to syntax highlight everything.
I mapped server-edit
to SPC-.
inside Spacemacs, so that I can quickly switch
between emacs and the terminal environment.