[email protected]$ export EDITOR=vimOR
[email protected]$ echo 'export EDITOR=vim' >> ~/.bash_profile~/.bash_profile will be read every time you log into the system. Now open any text file using more or less utility:
[email protected]$ less file.phpOR
[email protected]$ more file.phpI tend to use ‘less’ more often because I can arrow keys ( including vi arrow keys: j and k ) to scroll the page I am viewing, but you can’t do it with ‘more’. Now you can edit the file directly by pressing ‘v’ key from you keyboard, it will bring you to the vi edit at the line you were at on that file. Happy Linux.