Last active
March 27, 2018 22:15
-
-
Save eddieantonio/c096c780cf09c938e031 to your computer and use it in GitHub Desktop.
Vim Syntastic: automatically switch between python2 and python3 syntax checkers.
This file contains hidden or 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
" Place this file in {VIMHOME}/after/ftplugin/python.vim | |
" Must have syntastic >= 3.5.0-29 | |
" Use Python 3 when the shebang calls for it. | |
let b:syntastic_python_python_exec = | |
\ syntastic#util#parseShebang()['exe'] =~# '\m\<python3' | |
\ ? 'python3' | |
\ : 'python' | |
This file contains hidden or 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
#!/usr/bin/env python3 | |
def generator(): | |
yield from range(10) | |
This file contains hidden or 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
#!/usr/bin/env python | |
print "This is Python 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment