Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.01 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.01 KB

vim-print-debug

automatic "printf" style debugging for vim.
each new call returns a unique line with incrementing chars. eg "aaa", "bbb", "ccc".

it also leaves the print statements in a format where it's easy to add some variable interpolation.

this plugin is only for extreme professionals 😎

install

with your favourite plugin manager, sentriz/vim-print-debug.
or just copy the source into your vimrc.

and add a mapping:

nnoremap <leader>p :call print_debug#print_debug()<cr>

settings

g:print_debug_default

  • desc: template to use if no language was found
  • default:
let g:print_debug_default = '"{}"'

g:print_debug_templates

  • desc: debug line templates for different filetypes. (see :echo &filetype)
  • default:
let g:print_debug_templates = {
\   'go':         'fmt.Printf("+++ {}\n")',
\   'python':     'print(f"+++ {}")',
\   'javascript': 'console.log(`+++ {}`);',
\   'c':          'printf("+++ {}\n");',
\ }