I'm using vim for python scripting and currently approaching jedi-vim
for autocomplete, navigation and refactoring. But it would be nice to have some ide-like debugging facilities.
Is there some plugin available?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI'm using vim for python scripting and currently approaching jedi-vim
for autocomplete, navigation and refactoring. But it would be nice to have some ide-like debugging facilities.
Is there some plugin available?
I have successfully used vdebug for php and python, it provides the UI inside vim to visually step through the code, see stack traces, evaluate expressions, etc. But unfortunately, it's quite complex to setup (at least was when I was using it) - it requires the DBGP server and komodo's server worked for me. I also have helper snippets in my vimrc to automatically start the server and then start the debugger.
But recently I am only working with python and switched to the combination of ipdb / pdbpp console debuggers and I am quite happy with the experience.
I use ipdb
as primary debugger and pdbpp
provides additional "sticky" (full-screen) mode.
You just need to pip install ipdb
and pip install pdbpp
and then put a breakpoint (__import__('ipdb').set_trace()
) into your python module.
Once the script or web app stops at the breakpoint, I immediately enter sticky
to switch to the full-screen mode and then use n
/ s
and other pdb commands to steps through the code, inspect variables, etc.
Try the python-mode plugin. Its the closest thing to a python ide coupled to VIM. However, as far as I know python-mode and jedi-vim are not compatible.
If you need to add more power on top, like youcompleteme or syntastic, you have to build the collection yourself. I just combined a number of plugins: python-mode, syntastic, awesome-vim, youcompleteme. There's a lot of conflicts, and some of them dont work well with each other.
If you only want a debugger, I use the pudb module that provides a "graphical" interface (in the terminal, but with syntax highlight, windows...).
I launch it with :term python -m pudb %
, and it works very well for me.
NOTE: pudb has all the features of pdb, it only adds a graphical and convenient layer. even the shortcuts are the same.