• Stars
    star
    498
  • Rank 88,494 (Top 2 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neovim / Vim integration for Delve

vim-delve

This is a Neovim and Vim plugin for debugging Go applications using Delve. The project works a lot nicer on Neovim with the built-in terminal, so that's what we recommend. But it is decent to work with on Vim if you have Shougo/vimshell.vim installed.

If you like this project, please star it. If you feel even more generous, please follow @sebdah on Twitter!

Feature highlights

  • Go syntax highlighting of debug output (only Neovim)
  • Supports both breakpoints and tracepoints
  • Run the Delve debugger in a split view along side your code
  • Launches a Delve CLI, so all commands are supported in there
  • Leverages the Neovim terminal (only on Neovim)
  • Supports main as well as and non-main packages
  • Supports vimux optionally

animated example

Requirements

For Neovim and Vim 8, you really only need Delve to get started.

If you wish to use the vimux support, you'd need to have this plugin as well:

Requirements for Vim 7 and earlier

If you are on Vim versions older than 8, you'll also need the following two packages:

Installation

Using vim-plug, add the following to your init.vim if you're on Neovim or .vimrc, if you're on vim:

Plug 'sebdah/vim-delve'

Then reload neovim and run PlugInstall.

Commands

Command Comment
DlvAddBreakpoint Add a breakpoint at the current line.
DlvAddTracepoint Add a tracepoint at the current line.
DlvAttach <pid> [flags] Attach dlv to a running process.
DlvClearAll Clear all the breakpoints and tracepoints in the buffer.
DlvCore <bin> <dump> [flags] Debug core dumps using dlv core.
DlvConnect host:port [flags] Connect to a remote Delve server on the given host:port.
DlvDebug [flags] Run dlv debug for the current session. Use this to test main packages.
DlvExec <bin> [flags] Start dlv on a pre-built executable.
DlvRemoveBreakpoint Remove the breakpoint at the current line.
DlvRemoveTracepoint Remove the tracepoint at the current line.
DlvTest [flags] Run dlv test for the current session. Use this to debug non-main packages.
DlvTestCurrent [flags] Run dlv test for the current test or function. Use this to debug non-main packages.
DlvToggleBreakpoint Convenience method to toggle (add or remove) a breakpoint at the current line.
DlvToggleTracepoint Convenience method to toggle (add or remove) a tracepoint at the current line.
DlvVersion Print the dlv version.

Configuration

Setting Default value Comment
g:delve_backend default Defines the backend to use with Delve. Please refer to the Delve documentation for details on what you should set this value to.
g:delve_sign_group delve Set the sign group.
g:delve_sign_priority 10 Set the sign priority.
g:delve_breakpoint_sign_highlight WarningMsg Set the color profile for the sign.
g:delve_breakpoint_sign Sets the sign to use to indicate breakpoints in the gutter.
g:delve_tracepoint_sign_highlight WarningMsg Set the color profile for the sign.
g:delve_tracepoint_sign Sets the sign to use to indicate tracepoints in the gutter.
g:delve_cache_path $HOME . "/.cache/" . v:progname . "/vim-delve" The path to where the instructions file for dlv is stored.
g:delve_instructions_file g:delve_cache_path ."/". getpid() .".". localtime() The instructions file name.
g:delve_enable_syntax_highlighting 1 Turn syntax highlighting in the dlv output on or off.
g:delve_enable_linenr_highlighting 0 Turn line number highlighting on or off.
g:delve_new_command vnew Control if dlv should be opened in a vertical (vnew), horizontal (new), full screen window (enew) or full screen window in new tab(tabnew).
g:delve_use_vimux 0 Sets whether to use benmills/vimux].
g:delve_project_root Override the path to use for setting breakpoints/tracepoints.

The settings above can be set in your init.vim like this:

let g:delve_backend = "native"

Frequently Asked Questions

Got an error about lldb-server on Mac OS X

If you get a message like the one below on Mac OS X, try setting g:delve_backend to native.

could not launch process: exec: "lldb-server": executa ble file not found in $PATH

Example: let g:delve_backend = "native"

Contributing to vim-delve

Contributions to the project is most welcome. I'd be happy to review and merge pull requests. If you need any directions in your implementation we can always discuss that too.

What can I do to help?

There are many things that this project need, but some examples could be:

  • I don't know if this works on Windows. If you could try it out and or make it work that would be great.
  • I haven't tested the project thoroughly on Vim, if you could do that it'd be wonderful.
  • Answer questions from users
  • Or implement new features

License

MIT Licensed software.

More Repositories

1

dynamic-dynamodb

Dynamic DynamoDB provides auto scaling for AWS DynamoDB
Python
617
star
2

scrapy-mongodb

MongoDB pipeline for Scrapy. This module supports both MongoDB in standalone setups and replica sets. scrapy-mongodb will insert the items to MongoDB as soon as your spider finds data to extract.
Python
357
star
3

goldie

Golden file testing for Go
Go
226
star
4

meteor-chat-tutorial

Example Meteor chat application supporting GitHub authentication.
JavaScript
187
star
5

aws-ec2-assign-elastic-ip

Automatically assign Elastic IPs to AWS EC2 Auto Scaling Group instances
Python
176
star
6

git-pylint-commit-hook

Git pre-commit hook to check Python code quality with pylint. You can use this hook to prohibit Python code with a bad syntax to be checked in.
Python
143
star
7

dotfiles

My dotfiles
Vim Script
130
star
8

automated-ebs-snapshots

Script for managing automated AWS EBS snapshots
Python
89
star
9

meteor-autocompletion

Autocompletion using data from MeteorJS collections
JavaScript
48
star
10

markdown-toc

Table of Contents generator for Markdown
Go
22
star
11

pok3r-layout

Vortex Pok3r layout for Linux users
16
star
12

elliot.js

Near real time graph library, see web page or demo.html for examples
JavaScript
11
star
13

dynamodb-config-store

Store your configuration in DynamoDB
Python
11
star
14

vim-ide

Sebastian's vim IDE
Vim Script
8
star
15

password-generator

Simple password generator module for Python
Python
8
star
16

yayson

Yay! Beautiful JSON on the command line!
Python
3
star
17

procmon

Simple utility for checking if processes are running
Python
3
star
18

python-inspector

Used to track down which Python module and script that called your method / function. It will show you the exact Python file, line number and the actual line that made the call. The module is plug'n'playable, just import it and place a non-interfering hook in your code.
Python
3
star
19

markdown-docs

markdown-docs is a documentation generator for projects using Markdown. The problem with having Markdown files spread around your project is that it is hard to get an overview of all your documentation. markdown-docs solves this by collecting all of your Markdown files into one browsable HTML hierarchy.
Python
3
star
20

github-kanban

JavaScript
2
star
21

relic

AWS Cloud management tool written in Python 2.7 and Django
JavaScript
1
star
22

recharged

Electrical vehicle charging system
Go
1
star
23

chartista.js

JavaScript library for graphing
JavaScript
1
star
24

watchtower

Pythonic monitoring software
Python
1
star
25

answering-robot

Fooling around with Python and text searching
Python
1
star
26

meteor-parent-data-example

Example showing how to access parent data in MeteorJS.
JavaScript
1
star