tonyxty / quickfix.py

Run a Python script and format the exception traceback as Vim quickfix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

quickfix.py

image image Documentation Status

Run a Python script and format the exception traceback as Vim quickfix.

Installation

pip install --user quickfix-py

or using pipx

pipx install --spec git+https://github.com/tonyxty/quickfix.py quickfix-py

Usage

quickfix.py foobar.py foo bar

runs foobar.py with command line arguments foo bar under supervision. Once an exception is raised, quickfix.py prints the stack traceback in Vim quickfix format, one frame per line.

docs/vimrc_example provides an example vimrc configuration.

Currently only works for Python 3.x.

Command line options

  • By default, only those frames that are in "user" scripts are printed, standard library calls are skipped. --all enables printing all frames.
  • By default, quickfix.py catches Exceptions, but not KeyboardInterrupt. --interrupt enables catching ^C, thereby allowing conveniently locating an infinite loop.

thef__k mode

quickfix.py also supports "thefuck" mode, inspired by nvbn/thefuck. When --fuck option is given or the script is run as "thefuck.py", it outputs a line of command that opens sensible-editor at the location of exception. See docs/bashrc_example for idiomatic usages.

Credits

Authored by Tony Beta Lambda. This package was created with Cookiecutter and the ashwinvis/cookiecutter-pypackage project template.

About

Run a Python script and format the exception traceback as Vim quickfix

License:MIT License


Languages

Language:Python 69.1%Language:Makefile 30.9%