Emacs as vim

While emacs is clearly the right editor to use, vim sometimes comes came up handy for quick edit of system config files (most of the time with sudo). The emacs philosophy of being it’s own operating system that’s you never leave doesn’t gel too well with switching to root.

Well… until I added that to my .bashrc:

alias e="emacsclient -t"
alias E="SUDO_EDITOR=\"emacsclient -t -a emacs\" sudoedit"

As I always have an emacs server started (usually the first thing I do after I restart the computer, ~1/month), emacsclient comes up very fast. Just using e somefile for normal quick edits and E someconfigfile for conf editing is certainly convenient.

h/t: emacsredux

Leave a Reply

Your email address will not be published. Required fields are marked *