Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made python version configurable

  • Loading branch information...
commit 30875494e4becc74f82d09263866feed30fe4852 1 parent 1b71a87
@SirVer SirVer authored
Showing with 21 additions and 6 deletions.
  1. +6 −0 doc/UltiSnips.txt
  2. +15 −6 plugin/UltiSnips.vim
View
6 doc/UltiSnips.txt
@@ -77,6 +77,12 @@ To use UltiSnips, you need a python enabled Vim 7. You have python if either
yields '1'. Recent versions have been tested with python 2.7 and python 3.2,
theoretically, UltiSnips should work with all versions >= python 2.6.
+UltiSnips tries to autodetect which Vim Python command to use (there are two:
+:py and :py3). Unfortunately, some Vim versions choke when you test for both
+versions. In this case you have to tell UltiSnips which version to use via >
+
+ let g:UltiSnipsUsePythonVersion = 2 " or 3
+
Using Pathogen: *UltiSnips-using-pathogen*
If you are a Pathogen user, you can track the official mirror of UltiSnips on github: >
View
21 plugin/UltiSnips.vim
@@ -11,13 +11,22 @@ if exists('did_UltiSnips_vim') || &cp || version < 700
finish
endif
-let g:_uspy=":py3 "
-if !has("python3")
- if !has("python")
- echo "UltiSnips requires py >= 2.6 or any py3"
- finish
+if !exists("g:UltiSnipsUsePythonVersion")
+ let g:_uspy=":py3 "
+ if !has("python3")
+ if !has("python")
+ echo "UltiSnips requires py >= 2.6 or any py3"
+ finish
+ endif
+ let g:_uspy=":py "
+ endif
+ let g:UltiSnipsUsePythonVersion = "<tab>"
+else
+ if g:UltiSnipsUsePythonVersion == 2
+ let g:_uspy=":py "
+ else
+ let g:_uspy=":py3 "
endif
- let g:_uspy=":py "
endif
" Global Variables {{{
Please sign in to comment.
Something went wrong with that request. Please try again.