- Unsupervised Learning
- Posts
- How to Edit Your Crontab Using Vim
How to Edit Your Crontab Using Vim
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/6863fca0-e935-4ace-8f92-1459aab062dc/Screen-Shot-2017-11-21-at-15.11.19-e1511305924853.png)
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.
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ed3bddf2-cdb7-496a-8a7e-a82d1ec76437/maxresdefault-4-e1511308120869.jpg)
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.