parent
cecc7aad88
commit
2d18d53656
@ -5,6 +5,7 @@
|
|||||||
if exists('did_UltiSnips_autoload') || &cp || version < 700
|
if exists('did_UltiSnips_autoload') || &cp || version < 700
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
let did_UltiSnips_autoload=1
|
||||||
|
|
||||||
" Define dummy version of function called by autocommand setup in
|
" Define dummy version of function called by autocommand setup in
|
||||||
" ftdetect/UltiSnips.vim. If the function isn't defined (probably due to
|
" ftdetect/UltiSnips.vim. If the function isn't defined (probably due to
|
||||||
@ -13,26 +14,10 @@ endif
|
|||||||
function! UltiSnips#FileTypeChanged()
|
function! UltiSnips#FileTypeChanged()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if !exists("g:UltiSnipsUsePythonVersion")
|
call UltiSnips#bootstrap#Bootstrap()
|
||||||
let g:_uspy=":py3 "
|
if !exists("g:_uspy")
|
||||||
if !has("python3")
|
finish
|
||||||
if !has("python")
|
end
|
||||||
if !exists("g:UltiSnipsNoPythonWarning")
|
|
||||||
echo "UltiSnips requires py >= 2.6 or any py3"
|
|
||||||
endif
|
|
||||||
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
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" FUNCTIONS {{{
|
" FUNCTIONS {{{
|
||||||
function! s:compensate_for_pum()
|
function! s:compensate_for_pum()
|
||||||
@ -176,13 +161,3 @@ function! UltiSnips#LeavingInsertMode()
|
|||||||
exec g:_uspy "UltiSnips_Manager._leaving_insert_mode()"
|
exec g:_uspy "UltiSnips_Manager._leaving_insert_mode()"
|
||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Expand our path
|
|
||||||
exec g:_uspy "import vim, os, sys"
|
|
||||||
exec g:_uspy "new_path = os.path.abspath(os.path.join(
|
|
||||||
\ vim.eval('expand(\"<sfile>:h\")'), '..', 'pythonx'))"
|
|
||||||
exec g:_uspy "vim.command(\"let g:UltiSnipsPythonPath = '%s'\" % new_path)"
|
|
||||||
exec g:_uspy "if not hasattr(vim, 'VIM_SPECIAL_PATH'): sys.path.append(new_path)"
|
|
||||||
exec g:_uspy "from UltiSnips import UltiSnips_Manager"
|
|
||||||
|
|
||||||
let did_UltiSnips_autoload=1
|
|
||||||
|
@ -1,5 +1,40 @@
|
|||||||
" Kludge to make sure that this file is really run.
|
let s:SourcedFile=expand("<sfile>")
|
||||||
function! UltiSnips#variables#WasRun()
|
|
||||||
|
function! UltiSnips#bootstrap#Bootstrap()
|
||||||
|
if exists('did_UltiSnips_bootstrap')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let did_UltiSnips_bootstrap=1
|
||||||
|
|
||||||
|
if !exists("g:UltiSnipsUsePythonVersion")
|
||||||
|
let g:_uspy=":py3 "
|
||||||
|
if !has("python3")
|
||||||
|
if !has("python")
|
||||||
|
if !exists("g:UltiSnipsNoPythonWarning")
|
||||||
|
echo "UltiSnips requires py >= 2.6 or any py3"
|
||||||
|
endif
|
||||||
|
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
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Expand our path
|
||||||
|
exec g:_uspy "import vim, os, sys"
|
||||||
|
exec g:_uspy "sourced_file = vim.eval('s:SourcedFile')"
|
||||||
|
exec g:_uspy "while not os.path.exists(os.path.join(sourced_file, 'pythonx')):
|
||||||
|
\ sourced_file = os.path.dirname(sourced_file)"
|
||||||
|
exec g:_uspy "module_path = os.path.join(sourced_file, 'pythonx')"
|
||||||
|
exec g:_uspy "vim.command(\"let g:UltiSnipsPythonPath = '%s'\" % module_path)"
|
||||||
|
exec g:_uspy "if not hasattr(vim, 'VIM_SPECIAL_PATH'): sys.path.append(module_path)"
|
||||||
|
exec g:_uspy "from UltiSnips import UltiSnips_Manager"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" The trigger used to expand a snippet.
|
" The trigger used to expand a snippet.
|
@ -1,4 +1,4 @@
|
|||||||
call UltiSnips#variables#WasRun()
|
call UltiSnips#bootstrap#Bootstrap()
|
||||||
|
|
||||||
function! UltiSnips#map_keys#MapKeys()
|
function! UltiSnips#map_keys#MapKeys()
|
||||||
" Map the keys correctly
|
" Map the keys correctly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user