Hacker News new | ask | show | jobs
by MereInterest 4256 days ago
export EDITOR=emacs

Then crontab -e will start emacs instead of vi.

3 comments

Try:

    export ALTERNATE_EDITOR=emacs EDITOR=emacsclient VISUAL=emacsclient
and set up Emacs to run (server-start) on startup.

This way, crontab -e should open a new Emacs frame (or start Emacs, if it isn't already running). It will speed things up and make the experience better, while giving you access to all the things you're working on in an already running Emacs.

See also: http://www.emacswiki.org/EmacsClient.

If emacs is installed. It often isn't. vi almost always is.

I know enough vi to open a file, move up, down, left, and right, search, delete and insert text. And I often run afoul of my emacs muscle memory just doing that. But you really need to know the vi basics if you admin unix machines.

I’ve learnt enough ed to use that instead of vi. If that isn’t installed, I’ve had to resort to nano, and, in rare cases, sed --in-place. But I never need to know vi.

Of course I realize that this is mostly me being silly, but it’s also rather educational.

You are absolutely right. Especially if we are talking about BSD or Unix proper. But, there is a cognitive load to remembering what machine you are on, or if certain variables have been set and so on.

I have been on machines that fire up nano with crontab -e, in the name of user friendliness. These same machines will not respect EDITOR or VISUAL anyway, so I have no idea what to do about them. I usually just get up and creep away making sure not to turn my back on them.