Vim is an extensively configurable cross-platform and a highly efficient text editor.
Change default text editor linux command line. To set vi as the. Both the EDITOR and VISUAL environment variables determine which text editor is used at the default and you can set either to change the default behaviour to the text editor you prefer like so from the command line. Add the following lines to the bashrc file.
Sudo echo export EDITORusrbinvim homeJimbashrc sudo echo export EDITORbinnano homeAmybashrc. The vi part of this command selects the Vim text editor as the program to use. You can set a text editor as default with the update-alternatives command.
In an operating system such as Ubuntu you need to use a script inorder to change the default text editor known as the update-alternatives. For a file named sampletext for example youd type vi sampletxt. You have to set the environment variable EDITOR.
If youre on Linux for quite some time you must have heard about Vim. Below is the description of how you can go about doing it. How to change default text editor in Ubuntu.
Via your gitconfig file. An example of this is using the crontab command which allows you to edit your cron jobs using the default editor. If youre in your terminal head to your gitconfig file with nano gitconfig and make your changes.
To change the default command-line text editor follow these steps. While when using the command line so you are using the command line text editors. The default text editor when using the GUI is not the same as the command line text editors so when you are opening a file using GUI you probably are using the GUI text editors which is gedit by default.