vim-delve


Ⅰ. 插件描述

Neovim / Vim integration for Delve

Ⅱ. 基本信息

创建日期:  2017-07-05
使用用户:  97
Github星:  272
插件作者:  Sebastian Dahlgren

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'sebdah/vim-delve'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'sebdah/vim-delve'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'sebdah/vim-delve'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/sebdah/vim-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

  1. 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

If you are on vim (not neovim), you'll also need the following two packages:

If you wish to use vimux:

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

CommandComment
DlvAddBreakpointAdd a breakpoint at the current line.
DlvAddTracepointAdd a tracepoint at the current line.
DlvAttach <pid> [flags]Attach dlv to a running process.
DlvClearAllClear 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.
DlvRemoveBreakpointRemove the breakpoint at the current line.
DlvRemoveTracepointRemove the tracepoint at the current line.
DlvTest [flags]Run dlv test for the current session. Use this to debug non-main packages.
DlvToggleBreakpointConvenience method to toggle (add or remove) a breakpoint at the current line.
DlvToggleTracepointConvenience method to toggle (add or remove) a tracepoint at the current line.
DlvVersionPrint the dlv version.

Configuration

SettingDefault valueComment
g:delve_backenddefaultDefines the backend to use with Delve. Please refer to the Delve documentation for details on what you should set this value to.
g:delve_breakpoint_sign_highlightWarningMsgSet the color profile for the sign.
g:delve_breakpoint_signSets the sign to use to indicate breakpoints 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_enable_syntax_highlighting1Turn syntax highlighting in the dlv output on or off.
g:delve_new_commandvnewControl if dlv should be opened in a vertical (vnew), horizontal (new) or full screen window (enew).
g:delve_tracepoint_sign_highlightWarningMsgSet the color profile for the sign.
g:delve_tracepoint_signSets the sign to use to indicate tracepoints in the gutter.
g:delve_use_vimux 0Sets whether to use benmills/vimux].

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.

添加新评论