Setting Up Your Vimrc on Linux

Introduction to Vimrc

The .vimrc file is where you set your personal preferences for Vim. This guide will help you set up your .vimrc on a Linux system.

Using help in Vim to place the vimrc file

  1. Open Vim: Launch Vim from your terminal or command prompt.
  2. Access Help: Type :help vimrc and press Enter. This will take you to the help section on the .vimrc file.
  3. Read and Learn: Explore the information provided to understand the purpose and usage of the .vimrc file.

Creating and Editing Your Vimrc File

  1. Open your terminal.
  2. Check if the .vimrc file already exists in your home directory:
    • Run ls -la ~/ | grep .vimrc
  3. If the .vimrc file does not exist, create it:
    • Run touch ~/.vimrc
  4. Open the .vimrc file in Vim:
    • Run vim ~/.vimrc
  5. Insert the following basic settings to customize Vim:
set relnumber number      " Displays line numbers
  1. Save and exit the file:
    • Press Esc, then type :wq and press Enter.