Denops (/ΛdiΛnoΚps/,
pronounced dee-nops
) is an ecosystem for Vim / Neovim that allows
developers to write plugins in TypeScript / JavaScript powered by Deno.
Firstly, install the latest Deno. Refer to the Deno official manual for details.
Ensure that the deno
command is executable from Vim / Neovim (hereafter, when
we refer to "Vim" without restriction, we also include "Neovim"). You can
confirm this using the exepath()
function in Vim, as shown below:
:echo exepath('deno')
/usr/local/bin/deno
Alternatively, specify the absolute path of the Deno executable to the
g:denops#deno
variable, like so:
let g:denops#deno = '/usr/local/bin/deno'
Once Deno is set up, install vim-denops/denops.vim
as a general Vim plugin.
For example, using vim-plug:
Plug 'vim-denops/denops.vim'
To confirm if denops is working properly, also install vim-denops/denops-helloworld.vim like this:
Plug 'vim-denops/denops-helloworld.vim'
Then, confirm if denops is working by executing the DenopsHello
command:
:DenopsHello
Hello
Once you've confirmed that denops is working, you can remove
vim-denops/denops-helloworld.vim
.
You may encounter an issue where Denops plugins are slow to start up. This is because Denops requires a Deno process to start before, and the process startup can become a bottleneck, impairing usability.
In such cases, you can avoid this startup overhead by using a Shared server.
To use a shared server, add the following to your .vimrc
:
let g:denops_server_addr = '127.0.0.1:32123'
Now, set up the shared server by using vim-denops/denops-shared-server.vim. First, install the plugin:
Plug 'vim-denops/denops-shared-server.vim'
Then, set up the shared server by executing denops_shared_server#install()
:
:call denops_shared_server#install()
Note
Alternatively, you can launch the shared server manually using the
denops/@denops-private/cli.ts
script:
deno run -A --no-lock {path/to/denops.vim}/denops/@denops-private/cli.ts --hostname=127.0.0.1 --port=32123
Afterward, restart Vim, and you'll notice an improvement in the startup time of Denops plugins.
If you are using Windows, you may still face an issue where Denops plugins are
slow to start up, even with the shared server. One possible reason is that the
antivirus software, like Windows Defender, is scanning Deno's cache directory
(%LOACALAPPDATA%\deno
) every time Deno starts up. To avoid this, add Deno's
cache directory to the exclusion list of the antivirus software.
Refer to and follow Add an exclusion to Windows Security or your antivirus software manual to exclude Deno's cache directory from virus scans, with your own responsibility.
Denops determines the supported versions of Vim/Neovim/Deno based on the following support policy when updating the major version:
- For Vim, versions older than the latest version provided by Homebrew and the
version distributed by vim-win32-installer
- Windows users can install it by downloading the package from vim-win32-installer
- macOS users can install it through Homebrew
- Linux users have the flexibility to build any version they prefer
- Regarding Neovim/Deno, support extends to the two most recent minor versions.
- Both Neovim and Deno adhere to semantic versioning principles.
- Since Neovim is still in the 0.x version range, we assume that the 0.x.y version is considered part of the 0.x version, ensuring support for the latest available versions.
To learn how to write Denops plugins, refer to the Denops Documentation or read the code of the following Denops plugins:
- vim-denops/denops-helloworld.vim
- lambdalisue/gin.vim
- vim-skk/skkeleton
- Shougo/ddu.vim
- Find one from the
vim-denops
topic
Alternatively, join the
Slack workspace for vim-jp
and ask questions in the
#tech-denops
channel. Most of
the conversations are in Japanese, but most of us understand English, and you
can ask questions in English.
English slide in a talk at
VimConf 2023 Tiny (with Japanese)
Denops is mainly developed by members of vim-jp.
This ecosystem is strongly inspired by coc.nvim, which allows developers to write Vim/Neovim plugins in Node.js. We express our great respect and gratitude to the coc.nvim developers.
The code follows the MIT license, as stated in LICENSE. Contributors need to agree that any modifications sent to this repository follow the license.