Neovim LSP and DAP using Lua

7 min readFeb 22, 2021

LSP and DAP for Python, Golang, Rust, and Typescript/Javascript.

Neovim IDE with LSP and DAP


In my previous article, I walked through with you how to convert existing .vimrc to a Lua-based configuration and set up LSP for Lua.

In this article let’s add LSP and DAP support. Particularly I will focus on Python, Typescript, Golang, and Rust.

Installation of Language Servers

Let’s get started by installing the language server.

If you are using coc.nvim, normally the language server is installed automatically for you. For Neovim LSP, there are available plugins to automate this process. Here I will go through the manual installation steps.


For Python, let’s install pyright.

$ npm install -g pyright


For Golang, let’s install gopls.

$ GO111MODULE=on go get


For Rust, let’s use rust_analyzer. The easiest way to install is to download the binary, copy it to a folder, and add the folder to the environment PATH.


For Typescript, let’s install typescript-language-server.

$ npm install -g typescript-language-server

Configure LSP


Under plugins.lua, install nvim-lspconfig and completion-nvim.

-- LSP and completion
use { 'neovim/nvim-lspconfig' }
use { 'nvim-lua/completion-nvim' }

Run :luafile % and then :PackerInstall.


The current configuration already supports Lua LSP. I am going to leverage the existing configuration.

  • Under lua folder, create a new folder called lang.

Software engineer, Data Science and ML practitioner.