Setting Up Your init.vim for Neovim on Windows

Step 1: Using Help in Neovim to Understand init.vim

  1. Open Neovim: Launch Neovim from your terminal or command prompt.
  2. Access Help: Type :help init.vim and press Enter. This will take you to the help section specifically for the init.vim file.
  3. Read and Learn: Take some time to explore the information provided to understand the purpose and usage of the init.vim file.

Step 2: Creating Your init.vim File

  1. Navigate to your Neovim configuration directory. This is usually located at C:\Users\<YourUserName>\AppData\Local\nvim\. If this directory doesn’t exist, create it:
    • Open Command Prompt.
    • Type mkdir %LOCALAPPDATA%\nvim and press Enter.
  2. Check if the init.vim file already exists in this directory. If it doesn’t, you’ll need to create one:
    • Right-click inside the folder, select New > Text Document, and name it init.vim. Ensure the .txt extension is removed if file extensions are visible.

Step 3: Editing Your init.vim File

  1. Right-click on init.vim and choose Edit with Neovim to open the file in Neovim.
  2. Insert the following basic configurations to get started:
set number                      " Enable line numbers
set relativenumber              " Enable relative line numbers
set noerrorbells                " Turn off error bells
set tabstop=4                   " Number of spaces tabs count for
  1. Save your changes by typing :wq in Neovim and pressing Enter.

Step 4: Testing Your Configuration

  1. Reopen Neovim by typing nvim in the command prompt.
  2. Your new settings should now be active! You can test features like relative line numbering by opening any file.