项目作者: sentriz

项目描述 :
assisted printf debugging for vim
高级语言: Vim script
项目地址: git://github.com/sentriz/vim-print-debug.git
创建时间: 2020-08-22T15:36:02Z
项目社区:https://github.com/sentriz/vim-print-debug

开源协议:

下载


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:

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

settings

g:print_debug_default

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

g:print_debug_templates

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