How to Edit Your Crontab Using Vim

November 21, 2017

If you’re a vim user like I am > and you run crontab -e and get dropped into nano, you’re likely to make the same face as a baby eating a lemon.

A baby eating a lemon

Not fun, but there’s a fix.

Update your shell configuration file (.bashrc, .zshrc, .profile, whatever), to include the following:

alias crontab="export VISUAL=vim; crontab"

Then you can simply run the command normally to edit your crontab with vim.

crontab -e

No more nano, and good riddance.

supporting = loving

For 29.4666 years I've been creating ad-free technical tutorials and essays here. 3,031 pieces and counting.

It's a one-person effort that's also my livelihood. If it makes your day easier or more pleasant in any way, please consider supporting the work with a monthly or one-time donation.

It helps me make more content, and is deeply appreciated as well. 🫶🏼