Created
June 6, 2013 13:01
-
-
Save alfredodeza/5721329 to your computer and use it in GitHub Desktop.
Get the current Python version in Vim
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
function! PyVersion() | |
let out = system("python --version") | |
" Match on the first digit, fallback to 2 if nothing found | |
let major_version = get(matchlist(out, '\d'), 0, '2') | |
echo "This is Python version " . major_version | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment