How to specify the use of vim in Linux?

To designate vim as the default text editor in Linux, follow these steps:

  1. The file “.bashrc”
$ vi ~/.bashrc
  1. Add the following lines at the end of the document:
export EDITOR=vim
  1. Save and close the file.
  2. Enter the following command to apply the changes:
$ source ~/.bashrc

Now, when you run commands like crontab -e or git commit, Vim will be used as the default text editor.

bannerAds