From 52b1bac1c9116506114ff0bd390dbb49191b9942 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Fri, 28 Dec 2018 20:03:01 -0500 Subject: [PATCH] vim: add PDB command to open a perl debugger This function creates a new tab, opens the perl debugger, and sets the syntax to be perl so that you get some nice syntax highlighting (which currently only seems to work in neovim). --- vim/autoload/vimrc.vim | 11 +++++++++++ vim/vimrc | 1 + 2 files changed, 12 insertions(+) diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 5e69993..90541ef 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -64,3 +64,14 @@ function! vimrc#SetPasteAndPasteFromClipboard() abort normal! "*p set nopaste endfunction + +function! vimrc#PerlDebugger() abort + " Simple wrapper around term + syntax perl + tabedit + if has('nvim') + terminal perl -de0 + else + terminal ++curwin perl -de0 + end + setlocal syntax=perl +endfunction diff --git a/vim/vimrc b/vim/vimrc index 9d2b9a4..546147a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -196,6 +196,7 @@ nnoremap V :edit $MYVIMRC " COMMANDS {{{ command! -nargs=1 GitGrep call vimrc#GitGrep('') | copen command! CD exe 'cd ' . expand('%:h') +command! PDB call vimrc#PerlDebugger() " }}} " vim:fdm=marker:sts=4:sw=4 -- libgit2 0.28.4