首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何安装UltiSnips插件?

如何安装UltiSnips插件?
EN

Stack Overflow用户
提问于 2013-05-15 02:34:56
回答 3查看 6.3K关注 0票数 7

我试过安装UltiSnips插件,但当加载Vim时,它会产生大量错误:

代码语言:javascript
复制
Error detected while processing C:\Documents and Settings\username\vimfiles\bundle\UltiSnips-2.2\plugin\UltiSnips.vim:
line  226:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named os
line  229:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Documents and Settings\username\vimfiles\bundle\UltiSnips-2.2\pl
ugin\UltiSnips\__init__.py", line 4, in <module>
    from functools import wraps
ImportError: No module named functools
line  230:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'UltiSnips_Manager' is not defined
line  231:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'UltiSnips_Manager' is not defined
line  232:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'UltiSnips_Manager' is not defined

我所做的:

我安装了病原体插件,然后将'UltiSnips-2.2.tar.gz‘的内容提取到'vimfiles/bundle/’。

我找到了安装说明:

id=2715

说明中只提到了“安装”的概念,以指示如何获得源代码。没有一步一步的指示。粗略地看一下,我就会相信'UltiSnips-2.2.tar.gz‘的内容(直接提供在该页面上)与git存储库的内容是相同的。

编辑提供更多信息:

这是windows上的gvim。:echo has("python")返回1

有关python的相关:version位数是:

代码语言:javascript
复制
+python/dyn -python3
-DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python26.dll"

:version的全部内容

代码语言:javascript
复制
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan  4 2011 14:09:41)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-98
Compiled by digitectNO@SPAMdancingpaper.com
Huge version with GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info 
+comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search 
+farsi +file_in_path +find_in_path +float +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall
 +linebreak +lispindent +listcmds +localmap +lua/dyn +menu +mksession +modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang 
+mzscheme/dyn +netbeans_intg +ole -osfiletype +path_extra +perl/dyn +persistent_undo -postscript +printer +profile +python/dyn -python3 +quickfix 
+reltime +rightleft +ruby/dyn +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static 
-tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32 
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: gcc -O3 -fomit-frame-pointer -freg-struct-return -fno-strength-reduce -DWIN32 -DHAVE_PATHDEF -DFEAT_HUGE -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL="perl58.dll" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python26.dll" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL="msvcrt-ruby18.dll" -DDYNAMIC_RUBY_VER=18 -DFEAT_MZSCHEME -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL="libmzsch42.dll" -DDYNAMIC_MZGC_DLL="libmzgc42.dll" -DINCLUDE_MZSCHEME_BASE -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL="tcl85.dll" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL="lua51.dll" -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_OLE -march=i386 -Iproto -I/cygdrive/c/strawberry/perl/lib/CORE -I/cygdrive/c/RUBY/lib/ruby/1.8/i386-mswin32 -I/cygdrive/c/PROGRA~1/MzScheme/include -I/cygdrive/c/Tcl/include -I/cygdrive/c/PROGRA~1/Lua/5.1/include -s -mno-cygwin
Linking: gcc -s -o gvim.exe  -luuid -lole32 /cygdrive/c/Tcl/lib/tclstub85.lib -lwsock32 -mwindows -lcomctl32 -lversion -loleaut32 -lstdc++
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-08-31 01:33:46

确保使用python支持编译了vim。您可以通过运行

代码语言:javascript
复制
vim --version | grep python

并查找+python或运行echo has('python'),并查看它是否输出1。

如果使用python支持编译了vim,请确保python (2)在您的路径中。

票数 1
EN

Stack Overflow用户

发布于 2014-02-26 06:37:26

如果您没有根访问权限,其他选项是将ultisnips的版本降至1.3。您可以通过在git克隆之后运行以下命令来做到这一点。

代码语言:javascript
复制
git checkout tags/1.3

有妥协,但它是有效的!

票数 0
EN

Stack Overflow用户

发布于 2015-01-11 22:53:37

我遇到了同样的问题,不得不求助于安装多个Python。我目前的工作设置有gVim7.4、Python2.7.9 (只适用于UltiSnip :-/)和Python3.4 (这是我使用的)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16555852

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档