user@www$ export EDITOR=vimOR
user@www$ 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:
user@www$ less file.phpOR
user@www$ 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.