From 9037d2dd418bb0d6108aeb4c53c419db732fc5ac Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 7 Nov 2018 10:53:14 +0000 Subject: [PATCH] Default to using VIM's termdebug plugin for debug VIM 8.1 added the optional plugin termdebug which integrates gdb with separate buffers for source, output, and gdb console. This adds the `vimdebug` command which enables the termdebug plugin and executes the `:TermdebugCommand` with the given arguments. --- build/build.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/build.plugin.zsh b/build/build.plugin.zsh index 86e4e46..f2487da 100644 --- a/build/build.plugin.zsh +++ b/build/build.plugin.zsh @@ -7,7 +7,10 @@ alias build="build-dir --build" # Detect installed debugger and set the `debug` alias to debug a program with # command line arguments. if [ `uname` = Linux ]; then - if which cgdb &> /dev/null; then + if [[ "`vim --version`" =~ "^VIM - Vi IMproved 8\.1.*$" ]]; then + function vimdebug() { vim "+packadd termdebug" "+TermdebugCommand $*" } + alias debug='vimdebug' + elif which cgdb &> /dev/null; then alias debug='cgdb --args' elif which gdb &> /dev/null; then alias debug='gdb --args'