Skip to content

Instantly share code, notes, and snippets.

@KarateJB
Forked from SuryaThiru/compiler.python.vim
Created November 11, 2022 00:30
Show Gist options
  • Save KarateJB/7cb211598e5264402b3617231e113404 to your computer and use it in GitHub Desktop.
Save KarateJB/7cb211598e5264402b3617231e113404 to your computer and use it in GitHub Desktop.
Simple compiler for vim to fill python traceback in the quickfix window. Copy the file to `.vim/compiler/python.vim`.
" https://vi.stackexchange.com/questions/5110/quickfix-support-for-python-tracebacks
if exists("current_compiler")
finish
endif
let current_compiler = "python"
let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat=
\%*\\sFile\ \"%f\"\\,\ line\ %l\\,\ %m,
\%*\\sFile\ \"%f\"\\,\ line\ %l,
CompilerSet makeprg=python3\ %
let &cpo = s:cpo_save
unlet s:cpo_save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment