How to Modify/Change the Vimrc File in Vscode?

I am new to Vim and I have installed the Vim Extension in Vscode. I know that we can customize the default Vim Editor by modifying the vimrc file.

I want to change some keybindings in the VsCode Vim extension. How to do it/Where will I find the vimrc of Vscode Vim?

0

4 Answers

Make sure you have a /.vimrc or /_vimrc file in $HOME directory and follow the follow the following steps :

  1. Open VScode and go to settings.
  2. Type vimrc
  3. Enable Use Keymappings from a .vimrc file
  1. Modify the vimrc file according to your needs.
3

You may achieve the same result by inserting
"vim.vimrc.enable": true into your vscode setting.json.

2

Solution 1: @Jdeep's

Solution 2: Edit your .vimrc file from your Operating system's folder.

Or replace your personal .vimrc but make sure the filename is exactly (.vimrc) (yes, the period included as well)

If solution 1 and solution 2 don't work, verify vimrc in settings.json is enabled like this:

  1. Windows 10 user can open settings.json in
  • C:\Users<user>\AppData\Roaming\Code\User\settings.json
  1. Open VS Code
  2. Open settings.json (Control + ,)
  • File > Preferences > Settings > Enter "settings"
  • Note: don't click on a similar file named defaultSettings.json
  1. Scroll down and click on link "Edit in settings.json"
  1. verify "vim.vimrc.enable": true
  1. Save and reload VS Code
  • Windows machine in Powershell

    cd ~
    
    # create the .vimrc file - it might already exist
    New-Item -ItemType File .\.vimrc 
    
    # Open VS Code to modify your vim settings
    code .\.vimrc
    
  • In VS Code Press F1 and type Open Settings JSON

  • In settings.json add

    "vim.vimrc.enable": true
    
  • Navigate back to your .vimrc

And modify it as you please.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest