{"id":13469593,"url":"https://github.com/vscode-neovim/vscode-neovim","last_synced_at":"2025-05-12T20:48:59.294Z","repository":{"id":37280546,"uuid":"218653810","full_name":"vscode-neovim/vscode-neovim","owner":"vscode-neovim","description":"Vim mode for VSCode, powered by Neovim","archived":false,"fork":false,"pushed_at":"2025-05-04T21:44:21.000Z","size":4041,"stargazers_count":6941,"open_issues_count":57,"forks_count":239,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-04T22:33:46.429Z","etag":null,"topics":["hacktoberfest","neovim","neovim-backend","neovim-clients","neovim-guis","nvim","vim","vscode","vscode-extension","vscode-neovim"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vscode-neovim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["asvetliakov","theol0403","xiyaowong"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-10-31T00:46:23.000Z","updated_at":"2025-05-04T21:43:21.000Z","dependencies_parsed_at":"2023-10-14T15:58:01.351Z","dependency_job_id":"f19187e4-3f80-4070-8c9e-affde4442033","html_url":"https://github.com/vscode-neovim/vscode-neovim","commit_stats":{"total_commits":1244,"total_committers":94,"mean_commits":13.23404255319149,"dds":0.6221864951768489,"last_synced_commit":"ccd89d3e457ee968c09eb13d711bde0e0097a3f9"},"previous_names":[],"tags_count":160,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscode-neovim%2Fvscode-neovim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscode-neovim%2Fvscode-neovim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscode-neovim%2Fvscode-neovim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscode-neovim%2Fvscode-neovim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vscode-neovim","download_url":"https://codeload.github.com/vscode-neovim/vscode-neovim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253820107,"owners_count":21969477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","neovim","neovim-backend","neovim-clients","neovim-guis","nvim","vim","vscode","vscode-extension","vscode-neovim"],"created_at":"2024-07-31T15:01:46.228Z","updated_at":"2025-05-12T20:48:59.280Z","avatar_url":"https://github.com/vscode-neovim.png","language":"TypeScript","funding_links":["https://github.com/sponsors/asvetliakov","https://github.com/sponsors/theol0403","https://github.com/sponsors/xiyaowong"],"categories":["TypeScript","neovim","编辑器"],"sub_categories":["资源传输下载"],"readme":"# VSCode Neovim\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/icon.png\" height=\"128\"\u003e\u003cbr\u003eVSCode Neovim Integration\u003c/p\u003e\n\n\u003cp align=center\u003e\n\u003ca href=\"https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim\"\u003e\u003cimg src=\"https://img.shields.io/visual-studio-marketplace/v/asvetliakov.vscode-neovim?color=%234c1\u0026label=Visual%20Studio%20Marketplace\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/asvetliakov/vscode-neovim/actions/workflows/build_test.yml\"\u003e\u003cimg src=\"https://github.com/asvetliakov/vscode-neovim/workflows/Code%20Check%20\u0026%20Test/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitter.im/vscode-neovim/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\"\u003e\u003cimg src=\"https://badges.gitter.im/vscode-neovim/community.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[Neovim](https://neovim.io/) is a fork of Vim to allow greater extensibility and integration. This extension uses a\nfully embedded Neovim instance, no more half-complete Vim emulation! VSCode's native functionality is used for insert\nmode and VSCode commands, making the best use of both editors.\n\n- 🎉 Feature-complete Vim integration (except insert-mode and some Nvim UI plugins) by utilizing Nvim as a backend.\n- 🔧 Supports custom `init.lua` and most Nvim plugins.\n- 🥇 First-class and lag-free insert mode, letting VSCode do what it does best.\n- 🤝 Complete integration with VSCode features (lsp/autocompletion/snippets/multi-cursor/etc).\n\n\u003cstrong\u003eTable of Contents\u003c/strong\u003e\n\n- [🧰 Getting Started](#-getting-started)\n    - [Installation](#installation)\n    - [Neovim configuration](#neovim-configuration)\n    - [VSCode Settings \\\u0026 Commands](#vscode-settings--commands)\n- [💡 Tips and Features](#-tips-and-features)\n    - [VSCode specific differences](#vscode-specific-differences)\n    - [Troubleshooting](#troubleshooting)\n    - [Performance](#performance)\n    - [Composite escape keys](#composite-escape-keys)\n    - [Jumplist](#jumplist)\n    - [Multiple cursors](#multiple-cursors)\n    - [Remote development](#remote-development)\n- [⚡️ API](#️-api)\n    - [vscode.action(name, opts)](#vscodeactionname-opts)\n    - [vscode.call(name, opts, timeout)](#vscodecallname-opts-timeout)\n    - [vscode.on(event, callback)](#vscodeonevent-callback)\n    - [vscode.has_config(name)](#vscodehas_configname)\n    - [vscode.get_config(name)](#vscodeget_configname)\n    - [vscode.update_config(name, value, target)](#vscodeupdate_configname-value-target)\n    - [vscode.notify(msg)](#vscodenotifymsg)\n    - [vscode.eval(code\\[, opts, timeout\\])](#vscodeevalcode-opts-timeout)\n    - [vscode.eval_async(code\\[, opts\\])](#vscodeeval_asynccode-opts)\n    - [vscode.with_insert(callback)](#vscodewith_insertcallback)\n    - [Builtin module overrides](#builtin-module-overrides)\n    - [VimScript](#vimscript)\n- [⌨️ Keybindings (shortcuts)](#️-keybindings-shortcuts)\n    - [Keybinding Passthroughs](#keybinding-passthroughs)\n        - [Insert mode control keys passthrough](#insert-mode-control-keys-passthrough)\n        - [Normal mode control keys passthrough](#normal-mode-control-keys-passthrough)\n        - [Cmdline mode special keys passthrough](#cmdline-mode-special-keys-passthrough)\n        - [Disable passthrough for certain filetypes](#disable-passthrough-for-certain-filetypes)\n        - [Remove other vscode or passthrough keybindings](#remove-other-vscode-or-passthrough-keybindings)\n    - [Code navigation bindings](#code-navigation-bindings)\n    - [Explorer/list navigation bindings](#explorerlist-navigation-bindings)\n    - [Explorer file manipulation bindings](#explorer-file-manipulation-bindings)\n    - [Hover widget manipulation bindings](#hover-widget-manipulation-bindings)\n- [📟 Neovim Commands](#-neovim-commands)\n    - [File management](#file-management)\n    - [Tab management](#tab-management)\n    - [Buffer/window management](#bufferwindow-management)\n- [🎨 Highlights](#-highlights)\n- [🧰 Developing](#-developing)\n- [❤️ Credits \\\u0026 External Resources](#️-credits--external-resources)\n\n## 🧰 Getting Started\n\n### Installation\n\nInstall the [vscode-neovim](https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim) extension.\n\nInstall [Neovim](https://github.com/neovim/neovim/wiki/Installing-Neovim) **0.10.0** or greater.\n\n\u003e **Note:** Though the extension strives to be as compatible as possible with older versions of Neovim, some older\n\u003e versions may have quirks that are not present anymore. In light of this, certain configuration settings are\n\u003e recommended in some older versions for the best experience. These can be found\n\u003e [on the wiki](https://github.com/vscode-neovim/vscode-neovim/wiki/Version-Compatibility-Notes).\n\n\\[Optional\\] Set the Neovim path in the extension settings under\n\"`vscode-neovim.neovimExecutablePaths.win32/linux/darwin`\", respective to your system. For example,\n\"`C:\\Neovim\\bin\\nvim.exe`\" or \"`/usr/local/bin/nvim`\".\n\n\u003e **WSL Users:** If you want to use Neovim from WSL, set the `useWSL` configuration toggle and specify the Linux path to\n\u003e the nvim binary. `wsl.exe` Windows binary and `wslpath` Linux binary are required for this. `wslpath` must be\n\u003e available through `$PATH` Linux env setting. Use `wsl --list` to check for the correct default Linux distribution.\n\u003e\n\u003e **Snap Users:** If you want to use Neovim from Snap, the Neovim path must be resolved to the snap binary location. On\n\u003e some systems it might be \"`/snap/nvim/current/usr/bin/nvim`\". To check if you're running as a snap package, see if\n\u003e `which nvim` resolves to `/usr/bin/snap`.\n\n### Neovim configuration\n\nSince many Vim plugins can cause issues in VSCode, it is recommended to start from an empty `init.vim`. For a guide for\nwhich types of plugins are supported, see [troubleshooting](#troubleshooting).\n\nBefore creating an issue on Github, make sure you can reproduce the problem with an empty `init.vim` and no VSCode\nextensions.\n\nTo determine if Neovim is running in VSCode, add to your `init.vim`:\n\n```vim\nif exists('g:vscode')\n    \" VSCode extension\nelse\n    \" ordinary Neovim\nendif\n```\n\nIn lua:\n\n```lua\nif vim.g.vscode then\n    -- VSCode extension\nelse\n    -- ordinary Neovim\nend\n```\n\nTo conditionally activate plugins, the best solution is to use the\n[LazyVim VSCode extra](https://www.lazyvim.org/extras/vscode). However, `packer.nvim` and `lazy.nvim` have built-in\nsupport for `cond = vim.g.vscode` and `vim-plug` has a\n[few solutions](https://github.com/junegunn/vim-plug/wiki/tips#conditional-activation). See\n[plugins](https://github.com/vscode-neovim/vscode-neovim/wiki/Plugins) in the wiki for tips on configuring Vim plugins.\n\n### VSCode Settings \u0026 Commands\n\nYou can view all available [settings](https://code.visualstudio.com/docs/getstarted/settings) and commands by opening\nthe [vscode-neovim](vscode:extension/asvetliakov.vscode-neovim) extension details pane, and navigating to the features\ntab.\n\n## 💡 Tips and Features\n\n### VSCode specific differences\n\n- File and editor management commands such as `:e`/`:q`/`:vsplit`/`:tabnext`/etc are mapped to corresponding VSCode\n  commands and behavior may be different ([see below](#%EF%B8%8F-keybindings-shortcuts)).\n    - **Do not** use vim commands like `:e` in scripts/keybindings, they won't work. If you're using them in some custom\n      commands/mappings, you might need to rebind them to call VSCode commands from Neovim with\n      `require('vscode').call()` (see [API](#%EF%B8%8F-api)).\n    - Since version 1.18.0, `:w`, `:wa` and `:sav` commands are supported and no longer alias to VSCode commands. You\n      can use them as you would in Neovim.\n- When you type some commands they may be substituted for another, check\n  [AlterCommand](https://github.com/search?q=repo%3Avscode-neovim%2Fvscode-neovim%20AlterCommand\u0026type=code) for the list\n  of substitutions.\n- Scrolling is done by VSCode. \u003ckbd\u003eC-d\u003c/kbd\u003e/\u003ckbd\u003eC-u\u003c/kbd\u003e/etc are slightly different.\n- Editor customization (relative line number, scrolloff, etc) is handled by VSCode.\n- Dot-repeat (\u003ckbd\u003e.\u003c/kbd\u003e) is slightly different - moving the cursor within a change range won't break the repeat.\n  sequence. In Neovim, if you type `abc\u003ccursor\u003e` in insert mode, then move the cursor to `a\u003ccursor\u003ebc` and type `1` here\n  the repeat sequence would be `1`. However, in VSCode, it would be `a1bc`. Another difference is that when you delete\n  some text in insert mode, dot repeat only works from right to left, meaning it will treat \u003ckbd\u003eDel\u003c/kbd\u003e key as\n  \u003ckbd\u003eBS\u003c/kbd\u003e keys when running dot repeat.\n\n### Troubleshooting\n\n- View the logs via `Output: Focus on Output View` and select `vscode-neovim logs`.\n    - **To enable debug logs,** click the \"gear\" icon and select `Debug`, then click it again and choose\n      `Set As Default`.\n- Enable `vscode-neovim.neovimClean` in VSCode settings, which starts Nvim _without_ your plugins (`nvim --clean`). Nvim\n  plugins can do _anything_. Visual effects in particular can cause visual artifacts. vscode-neovim does its best to\n  merge the visual effects of Nvim and VSCode, but it's far from perfect. You may need to disable some Nvim plugins that\n  cause visual effects.\n- If you encounter rendering issues (visual artifacts), try \u003ckbd\u003eCTRL-L\u003c/kbd\u003e to force Nvim to redraw.\n- If you get the `Unable to init vscode-neovim: command 'type' already exists` message, uninstall other VSCode\n  extensions that use `registerTextEditorCommand(\"type\", …)` (like\n  [VSCodeVim](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim) or\n  [Overtype](https://marketplace.visualstudio.com/items?itemName=adammaras.overtype)).\n- On a Mac, the \u003ckbd\u003eh\u003c/kbd\u003e, \u003ckbd\u003ej\u003c/kbd\u003e, \u003ckbd\u003ek\u003c/kbd\u003e and \u003ckbd\u003el\u003c/kbd\u003e movement keys may not repeat when held, to fix\n  this open Terminal and execute the following command:\n  `defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false`.\n- To fix the remapped escape key not working in Linux, set `\"keyboard.dispatch\": \"keyCode\"`.\n- Two VSCode developer commands are useful for keybindings debugging:\n    - `Developer: Toggle Keyboard Shortcuts Troubleshooting` for tracing VSCode emitted keypresses and their processing\n      via defined keybindings.\n    - `Developer: Inspect Key Mapping` for getting the recognized mappings for the current keyboard layout inside\n      VSCode.\n\n### Performance\n\nIf you have any performance problems (cursor jitter usually) make sure you're not using vim plugins that increase\nlatency and cause performance problems.\n\nMake sure to disable unneeded plugins, as many of them don't make sense with VSCode. Specifically, you don't need any\ncode highlighting, completion, LSP plugins, or plugins that spawn windows/buffers (nerdtree , fuzzy-finders, etc). Most\nnavigation/textobject/editing plugins should be fine.\n\nFor example, make sure you're not using anything that renders decorators very often:\n\n- Line number extensions (VSCode has built-in support for normal/relative line numbers)\n- Indent guide extensions (VSCode has built-in indent guides)\n- Brackets highlighter extensions (VSCode has built-in feature)\n\n\u003e If you're not sure, disable all other extensions, **reload VSCode window**, and see if the problem persists before\n\u003e reporting it.\n\n### Composite escape keys\n\nSet with `compositeKeys` and tweak with `compositeTimeout`.\n\nExamples: add to your `settings.json`:\n\n\u003ckbd\u003ejj\u003c/kbd\u003e to escape\n\n```jsonc\n{\n    \"vscode-neovim.compositeKeys\": {\n        \"jj\": {\n            \"command\": \"vscode-neovim.escape\",\n        },\n    },\n}\n```\n\n\u003ckbd\u003ejk\u003c/kbd\u003e to escape and save\n\n```jsonc\n{\n    \"vscode-neovim.compositeKeys\": {\n        \"jk\": {\n            // Use lua to execute any logic\n            \"command\": \"vscode-neovim.lua\",\n            \"args\": [\n                [\n                    \"local code = require('vscode')\",\n                    \"code.action('vscode-neovim.escape')\",\n                    \"code.action('workbench.action.files.save')\",\n                ],\n            ],\n        },\n    },\n}\n```\n\n### Jumplist\n\nVSCode's jumplist is used instead of Neovim's. This is to make VSCode native navigation (mouse click, jump to\ndefinition, etc) navigable through the jumplist.\n\nMake sure to bind to `workbench.action.navigateBack` / `workbench.action.navigateForward` if you're using custom\nmappings. Marks (both upper \u0026 lowercased) should work fine.\n\n### Multiple cursors\n\nMultiple cursors work in:\n\n1. Insert mode\n2. Visual line mode\n3. Visual block mode\n\nTo spawn multiple cursors from visual line/block modes type \u003ckbd\u003ema\u003c/kbd\u003e/\u003ckbd\u003emA\u003c/kbd\u003e or \u003ckbd\u003emi\u003c/kbd\u003e/\u003ckbd\u003emI\u003c/kbd\u003e\n(by default). The effect differs:\n\n- For visual line mode, \u003ckbd\u003emi\u003c/kbd\u003e will start insert mode on each selected line on the first non whitespace character\n  and \u003ckbd\u003ema\u003c/kbd\u003e will on the end of line.\n- For visual block mode, \u003ckbd\u003emi\u003c/kbd\u003e will start insert on each selected line before the cursor block and \u003ckbd\u003ema\u003c/kbd\u003e\n  after.\n- \u003ckbd\u003emA\u003c/kbd\u003e/\u003ckbd\u003emI\u003c/kbd\u003e versions accounts for empty lines (only for visual line mode, for visual block mode\n  they're same as \u003ckbd\u003ema\u003c/kbd\u003e/\u003ckbd\u003emi\u003c/kbd\u003e).\n\nSee gif in action:\n\n![multicursor](https://github.com/vscode-neovim/vscode-neovim/assets/47070852/72b3f2b3-6d80-4ace-b6f4-b211baad74d1)\n\n\u003e **Note**: The built-in multi-cursor support may not meet your needs. Please refer to the plugin\n\u003e [vscode-multi-cursor.nvim](https://github.com/vscode-neovim/vscode-multi-cursor.nvim) for more multi-cursor features\n\n### Remote development\n\nWe intend to use vscode-neovim as a UI extension, so when you're using remote development, vscode-neovim is enabled in\nthe Local Extension Host, and it should work out of the box.\n\nIf you prefer to use the remote environment's copy of Neovim, rather than the locally installed one, vscode-neovim\nshould be installed in the Remote Extension Host. You can set the following in your VSCode `settings.json`:\n\n```json\n{\n    \"remote.extensionKind\": {\n        \"asvetliakov.vscode-neovim\": [\"workspace\"]\n    }\n}\n```\n\n\u003e **Note**: You will need to install neovim in the remote environment.\n\nFor more information:\n\n- [Remote Development](https://code.visualstudio.com/docs/remote/remote-overview)\n- [Extension Host](https://code.visualstudio.com/api/advanced-topics/extension-host)\n- [Remote Extensions](https://code.visualstudio.com/api/advanced-topics/remote-extensions)\n\n## ⚡️ API\n\nLoad the module:\n\n```lua\nlocal vscode = require('vscode')\n```\n\n\u003c!-- prettier-ignore-start --\u003e\n\u003e [!TIP]\n\u003e The previously used module named \"vscode-neovim\" is now deprecated, so don't be confused if \"vscode-neovim\" is used in old discussions or other resources.\n\u003c!-- prettier-ignore-end --\u003e\n\n1. `vscode.action()`: asynchronously executes a vscode command.\n2. `vscode.call()`: synchronously executes a vscode command.\n3. `vscode.on()`: defines a handler for some Nvim UI events.\n4. `vscode.has_config()`: checks if a vscode setting exists.\n5. `vscode.get_config()`: gets a vscode setting value.\n6. `vscode.update_config()`: sets a vscode setting.\n7. `vscode.notify()`: shows a vscode message (see also Nvim's `vim.notify`).\n8. `vscode.to_op()`: A helper for `map-operator`. See [code_actions.lua](./runtime/vscode/code_actions.lua) for the\n   usage\n9. `g:vscode_clipboard`: Clipboard provider using VSCode's clipboard API. Used by default when in WSL. See\n   `:h g:clipboard` for more details. Usage: `vim.g.clipboard = vim.g.vscode_clipboard`\n10. `vscode.eval()`: evaluate javascript synchronously in vscode and return the result\n11. `vscode.eval_async()`: evaluate javascript asynchronously in vscode\n12. `vscode.with_insert()`: perform operations in insert mode.\n\n### vscode.action(name, opts)\n\nAsynchronously executes a vscode command.\n\nParameters:\n\n- `name` (string): The name of the action, generally a vscode command.\n- `opts` (table): Map of optional parameters:\n    - `args` (table): List of arguments passed to the vscode command. If the command only requires a single object\n      parameter, you can directly pass in a map-like table.\n        - Examples:\n            - `action('foo', { args = { 'foo', 'bar', … } })`\n            - `action('foo', { args = { foo = bar, … } })`\n    - `range` (table): Specific range for the action. Implicitly passed in visual mode. Has three possible forms (all\n      values are 0-indexed):\n        - `[start_line, end_line]`\n        - `[start_line, start_character, end_line, end_character]`\n        - `{start = { line = start_line, character = start_character}, end = { line = end_line, character = end_character}}`\n    - `restore_selection` (boolean): Whether to preserve the current selection. Only valid when `range` is specified.\n      Defaults to `true`.\n    - `callback`: Function to handle the action result. Must have this signature: `function(err: string|nil, ret: any)`:\n        - `err` is the error message, if any\n        - `ret` is the result\n        - If no callback is provided, error will be shown as a VSCode notification.\n\nExample: open definition aside (default binding):\n\n```vim\nnnoremap \u003cC-w\u003egd \u003cCmd\u003elua require('vscode').action('editor.action.revealDefinitionAside')\u003cCR\u003e\n```\n\nExample: find in files for word under cursor (see the\n[vscode command definition](https://github.com/microsoft/vscode/blob/43b0558cc1eec2528a9a1b9ee1c7a559823bda31/src/vs/workbench/contrib/search/browser/searchActionsFind.ts#L177-L197)\nfor the expected parameter format):\n\n```vim\nnnoremap ? \u003cCmd\u003elua require('vscode').action('workbench.action.findInFiles', { args = { query = vim.fn.expand('\u003ccword\u003e') } })\u003cCR\u003e\n```\n\nExample: use in lua script:\n\n```lua\n-- Format current document\nvscode.action(\"editor.action.formatDocument\")\n\ndo -- Comment the three lines below the cursor\n  local curr_line = vim.fn.line(\".\") - 1  -- 0-indexed\n  vscode.action(\"editor.action.commentLine\", {\n    range = { curr_line + 1, curr_line + 3 },\n  })\nend\n\ndo -- Comment the previous line\n  local curr_line = vim.fn.line(\".\") - 1 -- 0-indexed\n  local prev_line = curr_line - 1\n  if prev_line \u003e= 0 then\n    vscode.action(\"editor.action.commentLine\", {\n      range = { prev_line , prev_line },\n    })\n  end\nend\n\ndo -- Find in files for word under cursor\n  vscode.action(\"workbench.action.findInFiles\", {\n    args = { query = vim.fn.expand('\u003ccword\u003e') }\n  })\nend\n```\n\nCurrently, two built-in actions are provided for testing purposes:\n\n1. `_ping` returns `\"pong\"`\n2. `_wait` waits for the specified milliseconds and then returns `\"ok\"`\n\n```lua\ndo -- Execute _ping asynchronously and print the result\n  vscode.action(\"_ping\", {\n    callback = function(err, res)\n      if err == nil then\n        print(res) -- outputs: pong\n      end\n    end,\n  })\nend\n```\n\n### vscode.call(name, opts, timeout)\n\nSynchronously executes a vscode command.\n\nParameters:\n\n- `name` (string): The name of the action, generally a vscode command.\n- `opts` (table): Same as [vscode.action()](#vscodeactionname-opts).\n- `timeout` (number): Timeout in milliseconds. The default value is -1, which means there is no timeout.\n\nReturns: the result of the action\n\nExample: format selection (default binding):\n\n```vim\nxnoremap = \u003cCmd\u003elua require('vscode').call('editor.action.formatSelection')\u003cCR\u003e\nnnoremap = \u003cCmd\u003elua require('vscode').call('editor.action.formatSelection')\u003cCR\u003e\u003cEsc\u003e\nnnoremap == \u003cCmd\u003elua require('vscode').call('editor.action.formatSelection')\u003cCR\u003e\n```\n\nExample: use in lua script:\n\n```lua\n-- Execute _ping synchronously and print the result\nprint(vscode.call(\"_ping\")) -- outputs: pong\n\n-- Wait for 1 second and print the return value 'ok'\nprint(vscode.call(\"_wait\", { args = { 1000 } })) -- outputs: ok\n\n-- Wait for 2 seconds with a timeout of 1 second\nprint(vscode.call(\"_wait\", { args = { 2000 } }), 1000)\n-- error: Call '_wait' timed out\n```\n\n### vscode.on(event, callback)\n\nCurrently no available events for user use.\n\n### vscode.has_config(name)\n\nCheck if configuration has a certain value.\n\nParameters:\n\n- `name` (string|string[]): The configuration name or an array of configuration names.\n\nReturns:\n\n- `boolean|boolean[]`: Returns `true` if the configuration has a certain value, `false` otherwise. If `name` is an\n  array, returns an array of booleans indicating whether each configuration has a certain value or not.\n\nExamples:\n\n```lua\n-- Check if the configuration \"not.exist\" exists\nprint(vscode.has_config(\"not.exist\"))\n-- Should return: false\n\n-- Check multiple configurations\nvim.print(vscode.has_config({ \"not.exist\", \"existing.config\" }))\n-- Should return: { false, true }\n```\n\n### vscode.get_config(name)\n\nGet configuration value.\n\nParameters:\n\n- `name` (string|string[]): The configuration name or an array of configuration names.\n\nReturns:\n\n- `unknown|unknown[]`: The value of the configuration. If `name` is an array, returns an array of values corresponding\n  to each configuration.\n\nExamples:\n\n```lua\n-- Get the value of \"editor.tabSize\"\nprint(vscode.get_config(\"editor.tabSize\")) -- a number\n\n-- Get multiple configurations\nvim.print(vscode.get_config({ \"editor.fontFamily\", \"editor.tabSize\" }))\n-- Should return: { \"the font family\", \"the editor tabSizse\" }\n```\n\n### vscode.update_config(name, value, target)\n\nUpdate configuration value.\n\nParameters:\n\n- `name` (string|string[]): The configuration name or an array of configuration names.\n- `value` (unknown|unknown[]): The new value for the configuration.\n- `target` (\"global\"|\"workspace\"|\"workspace_folder\"): The configuration target. Optional, defaults to\n  \"workspace_folder\".\n\nExamples:\n\n```lua\n-- Update the value of \"editor.tabSize\"\nvscode.update_config(\"editor.tabSize\", 16, \"global\")\n\n-- Update multiple configurations\nvscode.update_config({ \"editor.fontFamily\", \"editor.tabSize\" }, { \"Fira Code\", 14 })\n```\n\n### vscode.notify(msg)\n\nShow a vscode notification\n\nYou can set `vscode.notify` as your default notify function.\n\n```lua\nvim.notify = vscode.notify\n```\n\n### vscode.eval(code[, opts, timeout])\n\nEvaluate javascript inside vscode and return the result. The code is executed in an async function context (so `await`\ncan be used). Use a `return` statement to return a value back to lua. Arguments passed from lua are available as the\n`args` variable. The evaluated code has access to the\n[VSCode API](https://code.visualstudio.com/api/references/vscode-api) through the `vscode` global.\n\nTips:\n\n- Make sure to `await` on asynchronous functions when accessing the API.\n- Use the global `logger` (e.g. `logger.info(...)`) to log messages to the output of vscode-neovim.\n- JSON serializable values (primitives and simple objects) can be returned and will be automatically serialized then\n  deserialized to an equivalent lua value. If the return value is not JSON serializable then an error will be raised.\n- `globalThis['some_name'] = ...` can be used to persist values between calls.\n\nParameters:\n\n- `code` (string): The javascript to execute.\n- `opts` (table): Map of optional parameters:\n    - `args` (any): a value to make available as the `args` variable in javascript. Can be a single value such as a\n      string or a table of multiple values.\n- `timeout` (number): The number of milliseconds to wait for the evaluation to complete before cancelling. By default\n  there is no timeout.\n\nReturns:\n\n- The result of executing the provided code.\n\nExamples:\n\n```lua\nlocal current_file = vscode.eval(\"return vscode.window.activeTextEditor.document.fileName\")\nlocal current_tab_is_pinned = vscode.eval(\"return vscode.window.tabGroups.activeTabGroup.activeTab.isPinned\")\nvscode.eval(\"await vscode.env.clipboard.writeText(args.text)\", { args = { text = \"some text\" } })\n```\n\n### vscode.eval_async(code[, opts])\n\nLike `vscode.eval()` but returns immediately and evaluates in the background instead.\n\nParameters:\n\n- `code` (string): The javascript to execute.\n- `opts` (table): Map of optional parameters:\n    - `args` (any): a value to make available as the `args` variable in javascript. Can be a single value such as a\n      string or a table of multiple values.\n    - `callback`: Function to handle the eval result. Must have this signature: `function(err: string|nil, ret: any)`:\n        - `err` is the error message, if any\n        - `ret` is the result\n        - If no callback is provided, error will be shown as a VSCode notification.\n\n### vscode.with_insert(callback)\n\nPerform operations in insert mode. If in visual mode, this function will **preserve the selection** after switching to\ninsert mode.\n\nParameters:\n\n- `callback` (function): Callback function to run after switching to insert mode\n\nExample: make `editor.action.addSelectionToNextFindMatch` work correctly in any mode.\n\n```lua\nvim.keymap.set({ \"n\", \"x\", \"i\" }, \"\u003cC-d\u003e\", function()\n  vscode.with_insert(function()\n    vscode.action(\"editor.action.addSelectionToNextFindMatch\")\n  end)\nend)\n```\n\n![select-next](https://github.com/vscode-neovim/vscode-neovim/assets/47070852/5a93c87e-626a-4a70-a9ef-5084f747c7ef)\n\nExample: make \"editor.action.refactor\" work correctly on the selection and support snippet manipulation after entering\nVSCode snippet mode.\n\n```lua\nvim.keymap.set({ \"n\", \"x\" }, \"\u003cleader\u003er\", function()\n  vscode.with_insert(function()\n    vscode.action(\"editor.action.refactor\")\n  end)\nend)\n```\n\n![refactor](https://github.com/vscode-neovim/vscode-neovim/assets/47070852/1c436b76-5c0b-42a7-8eb4-6f149761dd3c)\n\n### Builtin module overrides\n\n1. [`vim.ui`](/runtime/vscode/ui.lua): use VSCode's UI components.\n2. [`vim.lsp.buf`](/runtime/vscode/lsp/buf.lua): execute corresponding VSCode LSP commands.\n\n### VimScript\n\n\u003e **Note:** Since 1.0.0, vimscript functions are deprecated. Use the [Lua](#%EF%B8%8F-api) api instead.\n\n- `VSCodeNotify()`/`VSCodeCall()`: deprecated, use [Lua](#%EF%B8%8F-api) `require('vscode').call()` instead.\n- `VSCodeNotifyRange()`/`VSCodeCallRange()`: deprecated, use [Lua](#%EF%B8%8F-api)\n  `require('vscode').call(…, {range:…})` instead.\n- `VSCodeNotifyRangePos()`/`VSCodeCallRangePos()`: deprecated, use [Lua](#%EF%B8%8F-api)\n  `require('vscode').call(…, {range:…})` instead.\n\nYou can also use `v:lua.require(\"vscode\")` to access the API from VimScript.\n\n## ⌨️ Keybindings (shortcuts)\n\nThere are three types of default/user keybindings:\n\n- **Neovim keybindings**: These are the keybindings that are defined in the extension's vimscript files or the user's\n  `init.vim` file. These provide code navigation, buffer management, and other neovim-specific overrides.\n- **VSCode keybindings**: These are the keybindings that are defined in the extension's `package.json` or the user's\n  `keybindings.json` file. These provide the ability to interact with VSCode's built-in features, and are used to make\n  VSCode more Vim-like.\n- **VSCode passthrough keybindings**: These are the keybindings that are defined in the extension's `package.json` or\n  the user's `keybindings.json` file, but simply pass the keypress through to Neovim. These are used to allow Neovim to\n  handle certain keypresses that would otherwise be handled by VSCode.\n\nThis document only mentions some special cases, it is not an exhaustive list of keybindings and commands. Use VSCode and\nNvim features to see documentation and all defined shortcuts:\n\n- Run the `Preferences: Open Keyboard Shortcuts` vscode command and search for \"neovim\" to see all vscode and\n  passthrough keybindings.\n- Use the Nvim `:help` command to see the documentation for a given neovim command or keybinding. For example try\n  `:help :split` or `:help zo`.\n    - Note that `:help` for `\u003cC-…\u003e` bindings is spelled `CTRL-…`. For example to see the help for `\u003cc-w\u003e`, run\n      `:help CTRL-W`.\n- Search the online Nvim documentation: \u003chttps://neovim.io/doc/user/\u003e\n- Reference the VSCode docs:\n    - Key Bindings: https://code.visualstudio.com/docs/getstarted/keybindings\n    - `\"when\"` clause: https://code.visualstudio.com/api/references/when-clause-contexts\n\n### Keybinding Passthroughs\n\nEvery special (control/alt/non-alphanumerical) keyboard shortcut must be explicitly defined in VSCode to send to neovim.\nBy default, only bindings that are used by Neovim by default are sent.\n\n\u003e **Note:** if you want to pass additional control keys without adding a custom passthrough, see below.\n\nTo add a custom passthrough, for example \u003ckbd\u003eA-h\u003c/kbd\u003e in normal mode, add to your `keybindings.json`:\n\n```jsonc\n{\n    \"command\": \"vscode-neovim.send\",\n    // Invoke the binding with this key sequence.\n    \"key\": \"alt+h\",\n    // Don't activate during insert mode.\n    // Docs for \"when\": https://code.visualstudio.com/api/references/when-clause-contexts\n    \"when\": \"editorTextFocus \u0026\u0026 neovim.mode != insert\",\n    // Send this input to Neovim.\n    \"args\": \"\u003cA-h\u003e\",\n}\n```\n\n#### Insert mode control keys passthrough\n\nSet by `vscode-neovim.ctrlKeysForInsertMode`.\n\nDefault: `[\"a\", \"d\", \"h\", \"j\", \"m\", \"o\", \"r\", \"t\", \"u\", \"w\"]`\n\n#### Normal mode control keys passthrough\n\nSet by `ctrlKeysForNormalMode`.\n\nDefault:\n`[\"a\", \"b\", \"d\", \"e\", \"f\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"o\", \"r\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\", \"/\", \"]\"]`\n\n#### Cmdline mode special keys passthrough\n\nAlways enabled.\n\n- Tab, Up, Down\n- Ctrl keys: `\u003cC-h\u003e` `\u003cC-w\u003e` `\u003cC-u\u003e` `\u003cC-n\u003e` `\u003cC-p\u003e` `\u003cC-l\u003e` `\u003cC-g\u003e` `\u003cC-t\u003e`\n- All `\u003cC-r\u003e` prefixed keys\n\n#### Disable passthrough for certain filetypes\n\nSet by `editorLangIdExclusions`.\n\nDisable keybindings defined by this extension in certain filetypes. Please note that this will not affect all\nkeybindings.\n\n#### Remove other vscode or passthrough keybindings\n\nIf the above configuration flags do not provide enough control, you can remove the keybindings by editing your\n`keybindings.json` or using the VSCode keybindings editor:\n\n![remove keybindings](https://github.com/vscode-neovim/vscode-neovim/assets/47070852/816e9734-bac3-4bbb-ab7f-13bf2e364794)\n\n### Code navigation bindings\n\n| Key                                                         | VSCode Command                                                                                 |\n| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |\n| \u003ckbd\u003e=\u003c/kbd\u003e / \u003ckbd\u003e==\u003c/kbd\u003e                                | `editor.action.formatSelection`                                                                |\n| \u003ckbd\u003egh\u003c/kbd\u003e / \u003ckbd\u003eK\u003c/kbd\u003e                                | `editor.action.showHover`                                                                      |\n| \u003ckbd\u003egd\u003c/kbd\u003e / \u003ckbd\u003eC-]\u003c/kbd\u003e                              | `editor.action.revealDefinition` \u003cbr/\u003e Also works in vim help.                                 |\n| \u003ckbd\u003egf\u003c/kbd\u003e                                               | `editor.action.revealDeclaration`                                                              |\n| \u003ckbd\u003egH\u003c/kbd\u003e                                               | `editor.action.referenceSearch.trigger`                                                        |\n| \u003ckbd\u003egO\u003c/kbd\u003e                                               | `workbench.action.gotoSymbol`                                                                  |\n| \u003ckbd\u003eC-w\u003c/kbd\u003e \u003ckbd\u003egd\u003c/kbd\u003e / \u003ckbd\u003eC-w\u003c/kbd\u003e \u003ckbd\u003egf\u003c/kbd\u003e | `editor.action.revealDefinitionAside`                                                          |\n| \u003ckbd\u003egD\u003c/kbd\u003e                                               | `editor.action.peekDefinition`                                                                 |\n| \u003ckbd\u003egF\u003c/kbd\u003e                                               | `editor.action.peekDeclaration`                                                                |\n| \u003ckbd\u003eTab\u003c/kbd\u003e                                              | `togglePeekWidgetFocus` \u003cbr/\u003e Switch between peek editor and reference list.                   |\n| \u003ckbd\u003eC-n\u003c/kbd\u003e / \u003ckbd\u003eC-p\u003c/kbd\u003e                             | Navigate lists, parameter hints, suggestions, quick-open, cmdline history, peek reference list |\n\n\u003e 💡 To specify the default peek mode, modify `editor.peekWidgetDefaultFocus` in your settings.\n\n### Explorer/list navigation bindings\n\n| Key                                 | VSCode Command                  |\n| ----------------------------------- | ------------------------------- |\n| \u003ckbd\u003ej\u003c/kbd\u003e or \u003ckbd\u003ek\u003c/kbd\u003e        | `list.focusDown/Up`             |\n| \u003ckbd\u003eh\u003c/kbd\u003e or \u003ckbd\u003el\u003c/kbd\u003e        | `list.collapse/select`          |\n| \u003ckbd\u003eEnter\u003c/kbd\u003e                    | `list.select`                   |\n| \u003ckbd\u003egg\u003c/kbd\u003e                       | `list.focusFirst`               |\n| \u003ckbd\u003eG\u003c/kbd\u003e                        | `list.focusLast`                |\n| \u003ckbd\u003eo\u003c/kbd\u003e                        | `list.toggleExpand`             |\n| \u003ckbd\u003eC-u\u003c/kbd\u003e or \u003ckbd\u003eC-d\u003c/kbd\u003e    | `list.focusPageUp/Down`         |\n| \u003ckbd\u003ezo\u003c/kbd\u003e or \u003ckbd\u003ezO\u003c/kbd\u003e      | `list.expand`                   |\n| \u003ckbd\u003ezc\u003c/kbd\u003e                       | `list.collapse`                 |\n| \u003ckbd\u003ezC\u003c/kbd\u003e                       | `list.collapseAllToFocus`       |\n| \u003ckbd\u003eza\u003c/kbd\u003e or \u003ckbd\u003ezA\u003c/kbd\u003e      | `list.toggleExpand`             |\n| \u003ckbd\u003ezm\u003c/kbd\u003e or \u003ckbd\u003ezM\u003c/kbd\u003e      | `list.collapseAll`              |\n| \u003ckbd\u003e / \u003c/kbd\u003e or \u003ckbd\u003eEscape\u003c/kbd\u003e | `list.toggleKeyboardNavigation` |\n\n### Explorer file manipulation bindings\n\n| Key          | VSCode Command                                |\n| ------------ | --------------------------------------------- |\n| \u003ckbd\u003er\u003c/kbd\u003e | `renameFile`                                  |\n| \u003ckbd\u003ed\u003c/kbd\u003e | `deleteFile`                                  |\n| \u003ckbd\u003ey\u003c/kbd\u003e | `filesExplorer.copy`                          |\n| \u003ckbd\u003ex\u003c/kbd\u003e | `filesExplorer.cut`                           |\n| \u003ckbd\u003ep\u003c/kbd\u003e | `filesExplorer.paste`                         |\n| \u003ckbd\u003ev\u003c/kbd\u003e | `explorer.openToSide`                         |\n| \u003ckbd\u003ea\u003c/kbd\u003e | `explorer.newFile`                            |\n| \u003ckbd\u003eA\u003c/kbd\u003e | `explorer.newFolder`                          |\n| \u003ckbd\u003eR\u003c/kbd\u003e | `workbench.files.action.refreshFilesExplorer` |\n\n### Hover widget manipulation bindings\n\n| Key            | VSCode Command                   |\n| -------------- | -------------------------------- |\n| \u003ckbd\u003eK\u003c/kbd\u003e   | `editor.action.showHover`        |\n| \u003ckbd\u003eh\u003c/kbd\u003e   | `editor.action.scrollLeftHover`  |\n| \u003ckbd\u003ej\u003c/kbd\u003e   | `editor.action.scrollDownHover`  |\n| \u003ckbd\u003ek\u003c/kbd\u003e   | `editor.action.scrollUpHover`    |\n| \u003ckbd\u003el\u003c/kbd\u003e   | `editor.action.scrollRightHover` |\n| \u003ckbd\u003egg\u003c/kbd\u003e  | `editor.action.goToTopHover`     |\n| \u003ckbd\u003eG\u003c/kbd\u003e   | `editor.action.goToBottomHover`  |\n| \u003ckbd\u003eC-f\u003c/kbd\u003e | `editor.action.pageDownHover`    |\n| \u003ckbd\u003eC-b\u003c/kbd\u003e | `editor.action.pageUpHover`      |\n\n## 📟 Neovim Commands\n\nDefault commands and bindings are available for file/scroll/window/tab management.\n\n#### File management\n\nSee [vscode-file-commands.vim](/runtime/vscode/overrides/vscode-file-commands.vim) for file commands reference.\n\nThe extension aliases various Nvim commands (`:edit`, `:enew`, `:find`, `:quit`, etc.) to equivalent vscode commands.\nAlso their normal-mode equivalents (where applicable) such as \u003ckbd\u003eC-w q\u003c/kbd\u003e, etc.\n\n#### Tab management\n\nSee [vscode-tab-commands.vim](/runtime/vscode/overrides/vscode-tab-commands.vim) for tab commands reference.\n\nThe extension aliases various Nvim tab commands (`:tabedit`, `:tabnew`, `:tabfind`, `:tabclose`, `:tabnext`,\n`:tabprevious`, `:tabfirst`, `:tablast`) to equivalent vscode commands. Also their normal-mode equivalents (where\napplicable) such as \u003ckbd\u003egt\u003c/kbd\u003e, etc.\n\n#### Buffer/window management\n\nSee [vscode-window-commands.vim](/runtime/vscode/overrides/vscode-window-commands.vim) for file commands reference.\n\nThe extension aliases various Nvim buffer/window commands (`:split`, `:vsplit`, `:new`, `:vnew`, `:only`) to equivalent\nvscode commands. Also their normal-mode equivalents (where applicable) such as \u003ckbd\u003eC-w s\u003c/kbd\u003e, etc.\n\n\u003e 💡 Split size distribution is controlled by `workbench.editor.splitSizing` setting. By default, it's `distribute`,\n\u003e which is equal to vim's `equalalways` and `eadirection = 'both'` (default).\n\nTo use VSCode command 'Increase/decrease current view size' instead of separate bindings for width and height:\n\n- `workbench.action.increaseViewSize`\n- `workbench.action.decreaseViewSize`\n\n\u003cdetails\u003e\n\u003csummary\u003eCopy this into init.vim\u003c/summary\u003e\n\n```vim\nfunction! s:manageEditorSize(...)\n    let count = a:1\n    let to = a:2\n    for i in range(1, count ? count : 1)\n        call VSCodeNotify(to ==# 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')\n    endfor\nendfunction\n\n\" Sample keybindings. Note these override default keybindings mentioned above.\nnnoremap \u003cC-w\u003e\u003e \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'increase')\u003cCR\u003e\nxnoremap \u003cC-w\u003e\u003e \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'increase')\u003cCR\u003e\nnnoremap \u003cC-w\u003e+ \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'increase')\u003cCR\u003e\nxnoremap \u003cC-w\u003e+ \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'increase')\u003cCR\u003e\nnnoremap \u003cC-w\u003e\u003c \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'decrease')\u003cCR\u003e\nxnoremap \u003cC-w\u003e\u003c \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'decrease')\u003cCR\u003e\nnnoremap \u003cC-w\u003e- \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'decrease')\u003cCR\u003e\nxnoremap \u003cC-w\u003e- \u003cCmd\u003ecall \u003cSID\u003emanageEditorSize(v:count, 'decrease')\u003cCR\u003e\n```\n\n\u003c/details\u003e\n\n## 🎨 Highlights\n\nThere are two ways to customize highlight colors:\n\n1. Set colors in nvim\n\n    **Note**: Due to the support for the `syntax` option requiring processing of syntax highlights, all built-in\n    highlight groups may be overridden or cleared. Therefore, please do not link any highlights to the built-in\n    highlight groups.\n\n2. Set colors in vscode\n\n    - [vscode-neovim.highlightGroups.highlights](https://github.com/vscode-neovim/vscode-neovim/blob/2657c4506b3dffe0d069db2891e30cebd963c2be/package.json#L160C1-L202C19)\n    - [ThemeColor](https://code.visualstudio.com/api/references/theme-color)\n\n## 🧰 Developing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.\n\n## ❤️ Credits \u0026 External Resources\n\n- [vim-altercmd](https://github.com/kana/vim-altercmd) - Used for rebinding default commands to call VSCode command.\n- [neovim nodejs client](https://github.com/neovim/node-client) - NodeJS library for communicating with Neovim.\n- [VSCodeVim](https://github.com/VSCodeVim/Vim) - Used for various inspiration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvscode-neovim%2Fvscode-neovim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvscode-neovim%2Fvscode-neovim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvscode-neovim%2Fvscode-neovim/lists"}