vimrc VIM Command

How to use vimrc Command in Linux VIM editor?

Explanation


In Vim you can set the settings, based on how you want vim to work. If you feel tired of typing the commands that you use often, then you can type and save all your favorite commands in a file called vimrc. These commands executed by Vim before it starts up.
If we don't have the file, then we can create the file using the following file name.
$ vim ~/.vimrc
If we have this vimrc configuration file then we can edit the file. The command to edit the file is as follows
:edit $MYVIMRC
Then we can write the set commands, which are necessary into the file.

Example:

  • Open the vimrc configuration file
    $ vim ~/.vimrc
  • To make the necessary changes in the file use,
    :edit $MYVIMRC
    vimrc VIM Command
  • To save the changes done in the file
    Press :w
  • Vim executes the command before starts up
  • Open the test.txt file to verify this.
    $ vim test.txt
  • The appearance of file will be as follows
    Configuration File Vim

Ask Questions

Ask Question