Modern Neovim— Debugging and Testing
Configure a modern debugging and test-driven development environment with Neovim.
In this article, we will focus on setting up a test-driven development environment with Neovim, with an integrated debugging user interface to debug the application and test cases.
This article is part of the Modern Neovim series.
The Neovim configuration files are available in this repository.
Getting Started
We already have a fully functional development environment using the current Neovim setup and using lazy.nvim
, we can easily extend the setup to support any other programming languages.
For a better development experience, and as part of standard software development practice, we will integrate test-driven development and debugging features into our current setup.
Debugging using DAP
Configuration
For debugging, we will use thenvim-dap
plugin and other DAP-related plugins.
We covered DAP extensively in the beginners series so we will not go through the basics here.
To install the DAP plugins using lazy.nvim
, we create the lua/plugins/dap/init.lua
file with the following code snippet.
Besides nvim-dap
, we configure the following plugins.
nvim-dap-ui
— a better user interface fornvim-dap
.nvim-dap-virtual-text
— adds virtual text support tonvim-dap.
telescope-dap.nvim
— integration fornvim-dap
withtelescope.nvim
.one-small-step-for-vimkind
— a debug adapter for the Neovim Lua language.
For our configuration,
- We configure the key…