For the love of vi!

Linux users seem to love vi as a text editor. There are even sites giving you reasons why you should use it. I guess it makes sense if you spend most of your time on the command line. If you use it every day then you will have no problem remembering all the key combinations to insert text, exit intert mode and exiting and saving files. As an infrequent user of text editors from the command line I have difficulty remembering all these keystrokes. As vi is always available on any unix and linux system it is of course useful to know how to use this program. On a Mac for example it will be the default text editor used by git when you are committing files. If you know vi then you don’t have to scramble for a browser to google how to enter text again. But there is also another way : you can change the default text editor to open from the terminal by changing your ~/.bash_profile. If you add following 2 lines to the end of this file then the nano editor will open instead of vi :

export EDITOR=nano
export VISUAL=”$EDITOR”

You can of course change nano to the editor of your liking. For me nano is a nice option just because it lists at the bottom of the file which key combinations you need to use to save a file and to exit for example. No need to remember even if you only sporadically use nano.

Leave a comment