Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vscode-neovim

> 后端框架
Open source

Vim mode for VSCode, powered by Neovim

7.7K stars0 likes1 views
WebsiteGitHub

About

Vim mode for VSCode, powered by Neovim

VSCode Neovim


VSCode Neovim Integration

Neovim is a fork of Vim to allow greater extensibility and integration. This extension uses a fully embedded Neovim instance, no more half-complete Vim emulation! VSCode's native functionality is used for insert mode and VSCode commands, making the best use of both editors.

  • Feature-complete Vim integration (except insert-mode and some Nvim UI plugins) by utilizing Nvim as a backend.
  • Supports custom init.lua and most Nvim plugins.
  • First-class and lag-free insert mode, letting VSCode do what it does best.
  • Complete integration with VSCode features (lsp/autocompletion/snippets/multi-cursor/etc).

Table of Contents

  • Getting Started
    • Installation
    • Neovim configuration
    • VSCode Settings & Commands
  • Tips and Features
    • VSCode specific differences
    • Troubleshooting
    • Performance
    • Composite escape keys
    • Jumplist
    • Multiple cursors
    • Remote development
  • ⚡️ API
    • vscode.action(name, opts)
    • vscode.call(name, opts, timeout)
    • vscode.on(event, callback)
    • vscode.has_config(name)
    • vscode.get_config(name)
    • vscode.update_config(name, value, target)
    • vscode.notify(msg)
    • vscode.eval(code[, opts, timeout])
    • vscode.eval_async(code[, opts])
    • vscode.with_insert(callback[, ms])
    • Builtin module overrides
    • VimScript
  • ⌨️ Keybindings (shortcuts)
    • Keybinding Passthroughs
      • Insert mode control keys passthrough
      • Normal mode control keys passthrough
      • Cmdline mode special keys passthrough
      • Disable passthrough for certain filetypes
      • Remove other vscode or passthrough keybindings
    • Code navigation bindings
    • Explorer/list navigation bindings
    • Explorer file manipulation bindings
    • Hover widget manipulation bindings
  • Neovim Commands
    • File management
    • Tab management
    • Buffer/window management
  • Highlights
  • Developing
  • ❤️ Credits & External Resources

Getting Started

Installation

  • Install the vscode-neovim extension.
  • Install Neovim 0.10.0 or newer.
    • (Optional) Set the Nvim path in the extension settings. You must specify the full path to Neovim, like C:\Neovim\bin\nvim.exe or /usr/local/bin/nvim.
    • Choose one of the following platform-specific settings:
      • vscode-neovim.neovimExecutablePaths.win32
      • vscode-neovim.neovimExecutablePaths.linux
      • vscode-neovim.neovimExecutablePaths.darwin
  • If you want to use Neovim from WSL, set the useWSL configuration toggle and specify the Linux path to the nvim binary. wsl.exe Windows binary and wslpath Linux binary are required for this. wslpath must be available through $PATH Linux env setting. Use wsl --list to check for the correct default Linux distribution.
  • Assign affinity value for performance improvement.

Snap Users: If you want to use Neovim from Snap, the Neovim path must be resolved to the snap binary location. On some systems it might be "/snap/nvim/current/usr/bin/nvim". To check if you're running as a snap package, see if which nvim resolves to /usr/bin/snap.

Neovim configuration

Since many Vim plugins can cause issues in VSCode, it is recommended to start from an empty init.vim. For a guide for which types of plugins are supported, see troubleshooting.

Before creating an issue on Github, make sure you can reproduce the problem with an empty init.vim and no VSCode extensions.

To detect if Nvim is running in VSCode, add to your init.vim:

vim
if exists('g:vscode')
    " VSCode extension
else
    " ordinary Nvim
endif

In lua:

lua
if vim.g.vscode then
    -- VSCode extension
else
    -- ordinary Nvim
end

To conditionally activate plugins, the best solution is to use the LazyVim VSCode extra. However, packer.nvim and lazy.nvim have built-in support for cond = vim.g.vscode and vim-plug has a few solutions. See plugins in the wiki for tips on configuring Vim plugins.

VSCode Settings & Commands

You can view all available settings and commands by opening the vscode-neovim extension details pane, and navigating to the features tab.

Tips and Features

VSCode specific differences

  • File and editor management commands such as :e/:q/:vsplit/:tabnext/etc are mapped to corresponding VSCode commands and behavior may be different (see below).
    • Do not use vim commands like :e in scripts/keybindings, they won't work. If you're using them in some custom commands/mappings, you might need to rebind them to call VSCode commands from Neovim with require('vscode').call() (see API).
    • Since version 1.18.0, :w, :wa and :sav commands are supported and no longer alias to VSCode commands. You can use them as you would in Neovim.
  • When you type some commands they may be substituted for another, check AlterCommand for the list of substitutions.
  • Scrolling is done by VSCode. C-d/C-u/etc are slightly different.
  • Editor customization (relative line number, scrolloff, etc) is handled by VSCode.
  • Dot-repeat (.) is slightly different - moving the cursor within a change range won't break the repeat. sequence. In Neovim, if you type abc<cursor> in insert mode, then move the cursor to a<cursor>bc and type 1 here the repeat sequence would be 1. However, in VSCode, it would be a1bc. Another difference is that when you delete some text in insert mode, dot repeat only works from right to left, meaning it will treat Del key as BS keys when running dot repeat.

Troubleshooting

  • To fix intermittent problems, you can run the Neovim: Restart Extension command to restart the extension.
  • View the logs via Output: Focus on Output View and select vscode-neovim logs.
    • To enable debug logs, click the "gear" icon and select Debug, then click it again and choose Set As Default.
  • Enable vscode-neovim.neovimClean in VSCode settings, which starts Nvim without your plugins (nvim --clean). Nvim plugins can do anything. Visual effects in particular can cause visual artifacts. vscode-neovim does its best to merge the visual effects of Nvim and VSCode, but it's far from perfect. You may need to disable some Nvim plugins that cause visual effects.
  • If you encounter rendering issues (visual artifacts), try CTRL-L to force Nvim to redraw.
  • If you get the Unable to init vscode-neovim: command 'type' already exists message, uninstall other VSCode extensions that use registerTextEditorCommand("type", …) (like VSCodeVim or Overtype).
  • On a Mac, the h, j, k and l movement keys may not repeat when held, to fix this open Terminal and execute the following command: defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false.
  • To fix the remapped escape key not working in Linux, set "keyboard.dispatch": "keyCode".
  • Two VSCode developer commands are useful for keybindings debugging:
    • Developer: Toggle Keyboard Shortcuts Troubleshooting for tracing VSCode emitted keypresses and their processing via defined keybindings.
    • Developer: Inspect Key Mapping for getting the recognized mappings for the current keyboard layout inside VSCode.

Performance

If you have any performance problems (cursor jitter usually) make sure you're not using vim plugins that increase latency and cause performance problems.

Make sure to disable unneeded plugins, as many of them don't make sense with VSCode. Specifically, you don't need any code highlighting, completion, LSP plugins, or plugins that spawn windows/buffers (nerdtree , fuzzy-finders, etc). Most navigation/textobject/editing plugins should be fine.

For example, make sure you're not using anything that renders decorators very often:

  • Line number extensions (VSCode has built-in support for normal/relative line numbers)
  • Indent guide extensions (VSCode has built-in indent guides)
  • Brackets highlighter extensions (VSCode has built-in feature)

If you're not sure, disable all other extensions, reload VSCode window, and see if the problem persists before reporting it.

Composite escape keys

Set with compositeKeys and tweak with compositeTimeout.

Examples: add to your settings.json:

jj to escape

jsonc
{
    "vscode-neovim.compositeKeys": {
        "jj": {
            "command": "vscode-neovim.escape",
        },
    },
}

jk to escape and save

jsonc
{
    "vscode-neovim.compositeKeys": {
        "jk": {
            // Use lua to execute any logic
            "command": "vscode-neovim.lua",
            "args": [
                [
                    "local code = require('vscode')",
                    "code.action('vscode-neovim.escape')",
                    "code.action('workbench.action.files.save')",
                ],
            ],
        },
    },
}

Jumplist

VSCode's jumplist is used instead of Neovim's. This is to make VSCode native navigation (mouse click, jump to definition, etc) navigable through the jumplist.

Make sure to bind to workbench.action.navigateBack / workbench.action.navigateForward if you're using custom mappings. Marks (both upper & lowercased) should work fine.

Multiple cursors

Multiple cursors work in:

  1. Insert mode
  2. Visual line mode
  3. Visual block mode

To spawn multiple cursors from visual line/block modes type ma/mA or mi/mI (by default). The effect differs

Issues· 58 open

View all issuesOpen on GitHub
  • #2699

    bug: Cross-file global mark jump is overwritten by VS Code's previous cursor position

    Updated Sep 29, 2026
  • #2698

    bug: taking over `type` breaks Copilot Chat newline bindings in chat input

    Updated Sep 29, 2026
  • #2689

    Integrate Native Neovim Multicursor

    Updated Sep 24, 2026
  • #2687

    refactor: eliminate postion/range/selection calculation logic

    category: metaUpdated Sep 19, 2026
  • #2598

    feature: Override neovim buffer commands & keymaps

    Updated Sep 19, 2026
  • #2677

    marketplace publish: "PATs in Azure DevOps are retired"

    category: metaUpdated Sep 18, 2026
  • #2609

    bug: Enter (newline) doesn't work properly when splitting an editor

    category: integrationUpdated Sep 13, 2026
  • #2614

    bug: 'z' is unconditionally swallowed in Windsurf Cascade chat input due to z-prefix list-fold chord

    manager: typingUpdated Sep 9, 2026
  • #2535

    bug: Visual mode behaves incorrectly for unicode characters not in the basic multilingual plane

    bugUpdated Jul 30, 2026
  • #2625

    bug: remapping hjkl in nvim config leads to issues with visual mode

    Updated Jul 10, 2026

> Tags

TypeScripthacktoberfestneovimneovim-backendneovim-clients

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架