I made a vim macro for this:
" Inspect the variable on the current line (in Ruby) autocmd FileType ruby nmap ,i ^"oy$Iputs "<esc>A: #{(<esc>"opA).inspect}"<esc>
Put the variable you want to check on the line, and then type ,i (comma and then i) in normal mode. It does this:
foo
in it:
puts "foo: #{(foo).inspect}"
This is good because it has no external dependencies (for example, you do not need to load the library to use it).
Benjamin Oakes Jun 28 '10 at 13:48 2010-06-28 13:48
source share