vimpdb 0.3.2
Vim and Pdb integration
Abstract
This package provides an integration of the Python debugger pdb into the VIM editor.
Requirements
vimpdb requires.
For Mac OS X, you’ll want to use MacVIM, for Linux and Windows the default build should be already server-enabled. MacVIM has python compiled in by default, also.
Installation
Just install this package using easy_install or similar:
$ easy_install vimpdb
Configuration
You might need to setup the VIMPDB_VIMSCRIPT environment variable. It should hold the command used at the shell prompt to launch a VIM supporting the options mentioned above. (Default value is vimpdb).
This script should also set the --servername option to specify a server name. You can think of this as a “window name” which is used to send remote commands to – this is how vimpdb communicates with a certain VIM instance.
Server Name
You might need to setup the VIMPDB_SERVERNAME environment variable. It should hold the name of the VIM server you will be using. (Default value is VIMPDB). You may list the currently running VIM servers using:
$ vim --serverlist VIM
Or, on a Mac:
$ /Applications/MacVim.app/Contents/MacOS/Vim --serverlist VIM
Note that the default servername is VIM
Starting a VIM Server for Debugging
You may start a VIM server for debugging like so:
$ vim --servername VIMPDB
Or, on a Mac, if you installed the mvim script:
$ mvim --servername VIMPDB
When a VIM supporting clientserver option has started, you can find its name by issuing the following command at the VIM prompt:
:echo v:servername
Using
Using vimpdb is easy – just call set_trace as usual:
import vimpdb; vimpdb.set_trace()
Now, when the python interpreter hits that line, VIM will get the focus and load the source file.
Now you’ll be able to
- Currently, when you stop debugging, the buffers which you debugged with are left in an inconvenient state : the keys mapped to Pdb commands are still mapped. In other words, switching from debugging to fixing code is not convenient.
- add option to allow other network settings (instead of hardcoded)
- try to start Vim server if it is not started
- try to guess Vim server name to avoid use of VIMPDB_SERVERNAME
- check and complain if Vim does not support the right options
- add command to set/reset key mappings/readonly state to allow to switch to editing mode
- register menu
- and much more…
- Author: Godefroid Chapelle
- License: MIT
- Package Index Owner: seletz, gotcha
- Package Index Maintainer: gotcha
- DOAP record: vimpdb-0.3.2.xml