Monday, October 3, 2011

set vim or vi as default editor

useful for setting editor from "nano" for such as crontab -e and svn commit command line commands which require using editor to prepare a parameter file. 

In defense of Nano, you can do an control O and then control X, but my fingers like vi


sudo update-alternatives –config editor 
There are 3 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path               Priority   Status
------------------------------------------------------------
  0            /bin/nano           40        auto mode
  1            /bin/ed            -100       manual mode
  2            /bin/nano           40        manual mode
* 3            /usr/bin/vim.tiny   10        manual mode


select desired editor from the list

No comments:

Post a Comment