如何在Centos 7盒子上为vim 7.4添加python支持?

时间:2016-03-20 00:03:53

标签: python-2.7 vim centos

我在谷歌搜索中尝试了几种解决方案,但似乎没有任何效果。这是我的vim --version的一个镜头,我目前安装了python 2.7.5:

Huge version without GUI.  Features included (+) or not (-):
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop
+farsi           +mouse_netterm   +syntax
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/local/include  -g -    O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -    lnsl  -ldl

1 个答案:

答案 0 :(得分:1)

我在这个thread上关注了一些问题,这让我起步了。我认为你可以跳过一些步骤,但我发现这是一个有效的解决方案:

1)删除已安装的vim

yum remove (all things vimish)

2)删除其他vim脚印

find / -name vim

3)添加软件集合实用程序

yum -y install scl-utils

4)添加python repo

rpm -Uvh https://www.softwarecollections.org/en/scls/rhscl/python33/epel-7-x86_64/download/rhscl-python33-epel-7-x86_64.noarch.rpm

4)安装python

yum -y install python33

5)安装gvim

yum install gvim

6)安装vim-enhanced

yum install vim-enhanced.x86_64

7)安装sudo

yum install sudo

在vim中执行:echo has(' python')并且它应该返回1,这意味着你现在有python支持。 **请注意,如果卸载vim-minimal,将卸载sudo。如果你从visudo复制你的设置并重新安装sudo后重新发布,我认为你应该没问题。

8)如果发生以下情况:

bash: /usr/local/bin/vim: No such file or directory

然后执行以下命令:

hash vim
vim

link

的此修复程序的详细信息