The Linux Page

crontab -e — change default editor, selected wrong editor

In Ubuntu 16.04, I wanted to add a user cron file with crontab -e, which has a new behavior: the very first time, it asks you what editor you want to use (i.e. nano, vim, ...)

If you choose the wrong one, then next time it does not ask you, it remembers your choice forever, so you'll be stuck.

The nano editor is okay, but difficult to work with if you're used to something like vim.

The data actually gets saved in a hidden file of your home directory named .selected_editor.

# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/usr/bin/vim"

Mine was set to "/bin/nano" instead of "/usr/bin/vim". You can just edit this file or delete it and crontab -e will re-ask you.

There is probably another way to set this up for your entire system, although I have not looked for a different solution at this point.

Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

Find the page/content you are looking for with our index.

  • SQL

    SQL, or Structure Query Language, is a programming language used to manage data in a relational database system. It was made an ANSI standard in 1986.

  • browser
  • language

    In computing, a language is a lexicon and grammar enabling a programmer to write software. There are interpreted and compiled languages. When compiling the computer transform the instructions of a program into instructions that the processor can execute natively.

  • object
  • screenshot