Skip to content

Instantly share code, notes, and snippets.

@dutc
Created October 23, 2014 00:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dutc/5a718c7c4411c2b10b55 to your computer and use it in GitHub Desktop.
Save dutc/5a718c7c4411c2b10b55 to your computer and use it in GitHub Desktop.
dedenting helpers for use with vim
#!/usr/bin/env python
from textwrap import dedent
if __name__ == '__main__':
from sys import stdin
exec dedent(''.join(stdin)) in locals(), globals()
#!/usr/bin/env python3
from textwrap import dedent
if __name__ == '__main__':
from sys import stdin
exec(dedent(''.join(stdin)), locals(), globals())
@dutc
Copy link
Author

dutc commented Oct 23, 2014

Use in vim to send lines from an unsaved file directly to an interpreter:

:'<,'>w ! dedent.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment