-
-
Save d3v-null/97a768bd609855a9d361a47f776eb4f6 to your computer and use it in GitHub Desktop.
My "one-liner" macro for pformatting an object with colour. I'd suggest using a snippet manager which supports cursor insertion (like Dash) to avoid having to scroll backwards to replace the @cursor placeholder. I have this mapped to ;cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygments import highlight; from pygments.lexers import PythonLexer; from pygments.formatters import Terminal256Formatter; from pprint import pformat; print(highlight(pformat( @cursor ), PythonLexer(), Terminal256Formatter())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment