commit 52b1bac1c9116506114ff0bd390dbb49191b9942 (patch)
parent 00ab7567d6d561b32b149f03d02484756e934dae
Author: Alex Karle <ajkarle@outlook.com>
Date: Fri, 28 Dec 2018 20:03:01 -0500
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).
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git 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
@@ -196,6 +196,7 @@ nnoremap <leader>V :edit $MYVIMRC<CR>
" COMMANDS {{{
command! -nargs=1 GitGrep call vimrc#GitGrep('<args>') | copen
command! CD exe 'cd ' . expand('%:h')
+command! PDB call vimrc#PerlDebugger()
" }}}
" vim:fdm=marker:sts=4:sw=4