Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
 
 
 
 

Insert-Debugger

About

This plugin inserts a debugger statement at the current position or alternatively wraps a visual selection with exception handling+debugger statement.

Installation

I recommend Vundle

Plugin 'codegourmet/insert-debugger'

Usage

Setup the method via your preferred keybinding inside .vimrc:

nmap <Leader>i :InsertDebugger<CR>
vmap <Leader>i :InsertDebuggerBlock<CR>

Settings

g:insert_debugger_language

let g:insert_debugger_language = 'ruby'

Default: 'ruby' Available: 'ruby', 'php'

Setting language dependent on filetype

autocmd FileType php let g:insert_debugger_language = 'php'
autocmd FileType ruby let g:insert_debugger_language = 'ruby'

Example for ruby

Before

previous_line()
cursor_line()

After execution without selection

previous_line()
require 'pry'; binding.pry
cursor_line()

After execution with visual selection

begin
  previous_line()
  cursor_line()
rescue
  require 'pry'; binding.pry
end

Example for php

Before

previousLine();
cursorLine();

After execution without selection

previousLine();
eval(\Psy\sh());
cursorLine();

After execution with visual selection

try {
  previousLine();
  cursorLine();
} catch (\Exception $e) {
  eval(\Psy\sh());
}

Contributing

If you think anything's missing or buggy please drop me a line or a pull request.

TODO

vim docs

License

MIT

About

This VIM plugin inserts a debugger statement or wraps a selection with an exception catching debugger statement

Resources

License

Releases

No releases published

Packages

No packages published