Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dradtke/vim-dap
Vim/Neovim debugger plugin providing a terminal interface to the Debug Adapter Protocol
https://github.com/dradtke/vim-dap
debug-adapter-protocol debugger neovim neovim-plugin vim vim-plugin
Last synced: about 2 months ago
JSON representation
Vim/Neovim debugger plugin providing a terminal interface to the Debug Adapter Protocol
- Host: GitHub
- URL: https://github.com/dradtke/vim-dap
- Owner: dradtke
- Created: 2020-01-22T03:16:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T23:04:52.000Z (about 2 years ago)
- Last Synced: 2024-06-10T02:31:43.905Z (7 months ago)
- Topics: debug-adapter-protocol, debugger, neovim, neovim-plugin, vim, vim-plugin
- Language: Vim Script
- Homepage:
- Size: 42.7 MB
- Stars: 48
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-dap
`vim-dap` is a Vim plugin for integrating with the
[Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/).
to provide full debugger functionality for Vim. Unlike other debugger plugins,
it doesn't attempt to replicate the user interface of an IDE; instead,
interaction with the debugger happens in the terminal, through a fully
readline-enabled debugger console:Neovim's LSP API appears to still be in flux, so if something isn't working, the
first thing to try would be to upgrade to the latest Neovim release.![demo](misc/demo.gif)
## Supported Languages
This plugin is intended to be as configuration-free as possible, but this section
will detail existing language support and their requirements.### Java
Java requires you to be running the
[eclipse.jdt.ls](https://github.com/eclipse/eclipse.jdt.ls) language server with
[java-debug](https://github.com/microsoft/java-debug) installed. The
`dap#run()` method requires you to be using either Neovim with native LSP
support, `vim-lsp` or `LanguageClient-neovim` as your client, but
`dap#connect()` can be called manually to connect to the debug adapter if it's
already running.In order to run the language server with debug support, you will need to
initialize the server with the path of the debug jar bundle. An example using
`settings.json`:```json
{
"initializationOptions": {
"bundles": ["/path/to/java-debug.jar"]
}
}
```You will also need to add all of the jars included in the server extension for
[vscode-java-test](https://github.com/microsoft/vscode-java-test). The easiest
way to do that is to download it from the VSCode Marketplace:```
https://vscjava.gallery.vsassets.io/_apis/public/gallery/publisher/vscjava/extension/vscode-java-test/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
```#### Debugger Settings
The [debug
settings](https://github.com/microsoft/java-debug/blob/master/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/DebugSettings.java)
can be customized by defining either a `.vim/launch.json` or
`.vscode/launch.json` file, i.e.```json
{
"javaHome": "/usr/lib/jvm/java-11-openjdk-amd64"
}
```#### Tips
To make it easier to run Java tests, I recommend adding something like this to your `.vimrc`.
With this in place, you can use `\rb` to run all tests in the current file, `\rf` to only run
the test which your cursor is in, and `\rl` to re-run the most recent test.```viml
au filetype java nmap rb :call dap#lang#java#run_test_class()
au filetype java nmap rf :call dap#lang#java#run_test_method()
au filetype java nmap rl :call dap#run_last()
```### Go
First, make sure that you have Delve installed and that `dlv` is available on your PATH.
Second, the debug adapter for Go is implemented as part of `vscode-go`, so your
system must have Node available in order for it to run (womp womp). It will be
automatically downloaded on first use.