Last Updated: February 25, 2016
·
1.882K
· mattboehm

Debug stack traces from within vim

I'll often view server logs in vim and come across a stack trace. I usually want to see more context around the error and possibly edit the files to fix the error right away. To help with this, I've made the Unstack plugin.

To use, either highlight part/all of a stack trace and type ,s or type ,s followed a motion (i.e. ,s4j). This will open the selected region on the appropriate lines in adjacent vertical splits in a new tab.

Image of Unstack running

This is still in early beta so features may change soon and it needs heavier testing, but your feedback/contributions are welcome.

If you're running a terminal program, you can do the following trick to view output in vim without writing to a file:

./foo.py 2>&1 | vim -