Setting Up a vimrc File on Windows

Step 1: 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.

Step 2: Creating Your vimrc File

  1. Navigate to the directory where Vim is installed, usually C:\Program Files (x86)\Vim.
  2. If you don’t see a _vimrc file in this directory, you’ll need to create one. To do this, right-click inside the folder, select New > Text Document, and name it _vimrc. Make sure to remove the .txt extension if your file extensions are visible.

Step 3: Editing Your vimrc File

  1. Right-click on _vimrc and choose Edit with Vim to open the file in Vim.
  2. Insert the following basic configurations to get started:
set relnumber number            " Show line numbers
  1. Save your changes by typing :wq in Vim and pressing Enter.

Step 4: Testing Your Configuration

  1. Open Vim by typing vim in the command prompt.
  2. Your new settings should now be active! You can test features like syntax highlighting by opening a code file.

Further Reading

  • To delve deeper into customizing Vim, consider reading :help vimrc in Vim.