6 ms·
Debugging In Vim
- CraigJPerry 13y agoThe site appears to be down for now but i got to the content via fullhn.com (there doesn't appear to be a permalink i can list for there, it's currently fullhn.com/#article-5)
- DiabloD3 13y agoI don't get why you'd want a debugger in Vim when you could just use tmux to get what you want in a cleaner way.
- tareqak 13y agoOne feature I can think of jumping to line numbers which come from make or compiler errors.
- chongli 13y agoVim has that with its quickfix window.
- dllthomas 13y agoFor live debugging there's still a need for some way of getting the source locations you're interested in into that quickfix window. Not that there aren't probably plugins &c that do just that, but it doesn't fall out as straightforwardly as parsing build errors.
- JoshTriplett 13y agoI'd like to single-step through the code displayed in a vim editor window, with all the power of vim to navigate it, plus commands to single-step, watch variables, set breakpoints, etc. tmux or screen can't give me that, nor can gdb -tui.
- jmcdowell 13y agoI was looking for the same thing, ended up using ddd, has watches, breakpoints etc. If you've found a better solution than that though feel free to let me know.
- JoshTriplett 13y agoFor everything except the data structure graphs, I prefer gdb's -tui option (split-screen code and "(gdb)" prompt) over ddd.
- Blinkky 13y agoHave a look at cgdb, it's gdb with a UI modeled after vim. http://cgdb.github.io/ http://cgdb.github.io/
- ktf 13y agoI highly recommend vdebug (https://github.com/joonty/vdebug https://github.com/joonty/vdebug) if you're looking for a great Vim interface to DBGP debuggers (for PHP, Python, Ruby, Perl, Node, etc.). Really nice, especially compared to the countless half-broken and out-of-date Vim/DBGP plugins that are scattered around vim.org and github.
- puller 13y agoMaybe this is great for PHP, where DBGP is the standard, but... I tried this for Python and was greatly put off by the need to download an obscure debugger tarball from ActiveState with some weird license on it, then (according to the vdebug documentation) run a very long command line by hand passing the name of the script every time I want to debug something. If I am going to trouble myself with that, it's hard to understand why I don't just run a standard standalone debugger which works in the expected way, from the command line. I definitely don't see how it reproduces the experience of (say) pressing a debug button in Visual Studio or Xcode.
- ktf 13y agoYeah, I guess I should have qualified the above by saying that I've only used it with PHP/xdebug (so far). Still, if you're trapped in the DBGP world for whatever reason, vdebug is miles better than any competition that I've found.
- jamesmiller5 13y agoI have also had a great time using `ddd` which is a lovely front-end for GDB. It's memory visualizer has helped me tremendously when learning complicated data structures.
- cel 13y agoSimilarly, debug JS in Vim (also using the netbeans protocol): node-vim-debugger https://github.com/sidorares/node-vim-debugger https://github.com/sidorares/node-vim-debugger presentation: http://andreysidorov.com/presentations/melbjs/0913/ http://andreysidorov.com/presentations/melbjs/0913/
- lightblade 13y agoIs this ready yet? I can't seem to find the node-vim-inspector.
- cel 13y agoLooks like the npm package is out of date. Try cloning the source repo and running ./bin/node-vim-inspector.js