Skip to content

Instantly share code, notes, and snippets.

@codesnik
Created February 13, 2009 00:49
Show Gist options
  • Save codesnik/62976 to your computer and use it in GitHub Desktop.
Save codesnik/62976 to your computer and use it in GitHub Desktop.
# эта хрень подключается так:
# vim --servername 'VIM'
# rdebug -rvim path/to/script
#
# команда v - заставит отобразить текущую файл и строку в запущенном vim-е
#
# Debugger::Command.settings[:autovim]=1 заставит делать это после
# каждого шага
module Debugger
# Implements debugger "list" command.
class VimCommand < Command
register_setting_get(:autovim) do
VimCommand.always_run
end
register_setting_set(:autovim) do |value|
VimCommand.always_run = value
end
def regexp
/^\s* v(?:im)$/x
end
def execute
system "vim --remote +#{@state.line} #{@state.file}"
end
class << self
def help_command
'list'
end
# doesn't work. use Debugger::Command.settings[:autovim]
def help(cmd)
%{
vim
}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment