vim下安装jedi-vim自动vim全能补全太慢了没有效果

如何安装jedi vim插件_百度知道
如何安装jedi vim插件
我有更好的答案
用户自己的插件放在 ~/.vim/ftplugin 下面,插件的文件名应当是 &文件类型.vim&. 针对同一个文件类型有很多插件的, 可以在上述目录下建立子目录 (和文件类型一致), 例如建立 ~/.vim/ftplugi/tex 目录,然后把有关 tex 和 latex 的插件都放在这个目录中,这时候子目录下的文件名可以随便取,只要以 .vim 为后缀即可.系统级的插件放在 /usr/local/share/vim/vim74/ftplugin 下面 (这是你自己编译安装的 vim,而且是配置在 /usr/local 中,系统自带的 vim 则放在 /usr/share/vim/vim74/ftplugin 下面,这裏的 74 是 vim 的版本号 7.4 的缩写,其他版本类似)。
  用vundle很容易安装。安装了vundle之后,直接在你的.vimrc里面加上  Bundle 'davidhalter/jedi-vim'  保存之后重新进入vim,用:BundleInstall就可以。jedi其他的配置基本都是自动生效的。
本回答被网友采纳
Arch Linux 直接 pacman -S vim-jedi 即可。
为您推荐:
其他类似问题
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。VIM自动补全神器 --- YouCompleteMe 安装全教程 - 简书
VIM自动补全神器 --- YouCompleteMe 安装全教程
这是一个漫长的安装过程,但在工作中十分实用
最基本的准备
linux系统(本机UBUNTU 14.04)
Vim 7.3以上版本(本机Vim 7.4)
Ubuntu系统可以通过以下命令安装 vim , git , cmake
1. sudo apt-get install vim
2. sudo apt-get install git
3. sudo apt-get install cmake
其他系统的安装方法请自行搜索
接下来安装
LLVM-Clang 3.3
Clang 标准库
安装LLVM-Clang 3.3
注意:不要跳过任何一步,除非你可以确定已经安装或者不需要。
mkdir ~/llvm-clang
点击链接,放到刚创建的llvm-clang文件夹中
终端工作目录在llvm-clang/
1. tar -xvzf llvm-3.3.src.tar.gz
2. tar -xvzf compiler-rt-3.3.src.tar.gz
3. tar -xvzf clang-tools-extra-3.3.src.tar.gz
4. tar -xvzf cfe-3.3.src.tar.gz
为了可以一起编译
1. mv cfe-3.3.src/ llvm-3.3.src/tools/clang/
2. mv clang-tools-extra-3.3.src/ llvm-3.3.src/tools/clang/extra/
3. mv compiler-rt-3.3.src/ llvm-3.3.src/projects/compiler-rt/
LLVM、clang 及辅助库源码
1. cd ~/llvm-clang
2. svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
3. cd llvm/tools
4. svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
5. cd ../..
6. cd llvm/tools/clang/tools
7. svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
8. cd ../../../..
9. cd llvm/projects
10. svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
创建编译文件夹
防止污染源码
1. cd ~/llvm-clang
2. mkdir llvm-build
3. cd llvm-build/
4. ../llvm-3.3.src/configure --enable-optimized
此种配置后,llv-clang默认安装到目录 /usr/local/ 下, 如果想改变安装目录,则加上配置: –prefix=Path 来制定
这个过程很漫长,请耐心等待…
1. make -j4
2. sudo make install
如果以后要卸载:
1. cd ~/llvm-clang
2. sudo make uninstall
安装Clang 标准库
clang 的标准库————libc++(接口层)和 libc++abi(实现层)需要安装头文件和动态链接库(.so) *
安装 libc++
1. cd ~/llvm-clang
2. svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
3. cd libcxx/lib
4. ./buildit
复制.so文件和头文件
1. sudo cp -r ~/llvm-clang/libcxx/include/ /usr/include/c++/v1/
2. ln -s ~/llvm-clang/libcxx/lib/libc++.so.1.0 ~/llvm-clang/libcxx/lib/libc++.so.1
3. ln -s ~/llvm-clang/libcxx/lib/libc++.so.1.0 ~/llvm-clang/libcxx/lib/libc++.so
4. sudo cp ~/llvm-clang/libcxx/lib/libc++.so* /usr/lib/
复制需要管理权限,也就是输入密码…
安装 libc++abi 和 动态链接库,以及复制…
~/llvm-clang/
2. svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi
3. cd libcxxabi/lib
4. ./buildit
6. sudo cp -r ~/llvm-clang/libcxxabi/include/ /usr/include/c++/v1/
7. ln -s ~/llvm-clang/libcxxabi/lib/libc++abi.so.1.0 ~/llvm-clang/libcxxabi/lib/libc++abi.so.1
8. ln -s ~/llvm-clang/libcxxabi/lib/libc++abi.so.1.0 ~/llvm-clang/libcxxabi/lib/libc++abi.so
9. sudo cp ~/llvm-clang/libcxxabi/lib/libc++abi.so* /usr/lib/
至此,前期准备完毕。
开始编译安装 YCM
通过 Vundle 或 git 安装 YCM
编辑.ycm_extra_conf.py
配置 .vimrc
通过 Vundle 安装 YCM
注意:此方法简单但不直观,下载过程没有及时反馈,可能让人失去耐心(难道只有我是这样的?)
本段参考–百度linux贴吧: 作者:萝卜特头
**安装Vundle **
1.将Vundle安装到 ~/.vim/bundle/vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
2.编辑 .vimrc 文件
gedit ~/.vimrc
在文件末尾添加
""""""""""""""""""""" Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundel#rc()
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
filetype plugin indent on
""""""""""""""""""""" Vundle
关键的是其中以Bundle开头的行,每一个Bundle代表一个vim插件,这些省略完整URL插件都是托管在
上的。如果想要安装新的插件,在call vundle#rc()和filetype plugin indent on
之间添加新的Bundle插件名称
3.开始下载安装
:source ~/.vimrc
:BundleInstall
如果你发现,这怎么这么久都没动静,是正常的,几十M且歪果服务器呢。
安装过程中,正在安装的插件左边会有 & 标识,安装完毕的是 +或- 。
安装结束后,会在状态栏看见Done字样。
注意:安装结束之后,打开vim会出现错误:
ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] you need
to compile YCM before using it. Read the docs!
通过 git 安装 YCM
本段参考– marchtea 的博客,被 引用。
进入目标文件夹并下载
mkdir ~/.vim/bundle/
cd ~/.vim/bundle/
git clone --recursive https://github.com/Valloric/YouCompleteMe.git
git submodule update --init --recursive
创建文件夹,如果已经存在,可以跳过。
进入文件夹
从 git 下载 YCM 文件
检查仓库(即文件夹)的完整性,不可跳过
下载过程挺久,但能看到屏幕一堆堆东西跑过去还是比较安心的呀!
进入文件夹开始编译
cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer --system-libclang
1.进入文件夹
2.编译。--clang-completer是用于C-Family的补全,不需要可以去掉。因为系统已经安装好了clang,所以有--system-libclang
创建文件夹并开始编译
mkdir ~/ycm_build
cd ~/ycm_build
cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBclang=ON -DEXTERNAL_LIBCLANG_PATH=/usr/local/lib/libclang.so . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
make ycm_core
make ycm_support_libs
1.创建编译目录
2.进入目录
3.开始编译
4.在YouCompleteMe中生成libclang.so和ycm_core.so文件
5.生成第三个文件ycm_client_support.so
注意: 如果这里出错,大概到80%时说缺少头文件&clang.h&什么的,那就是前面没有认真安装好。
编辑.ycm_extra_conf.py
gedit ~/.ycm_extra_conf.py
输入(如果已存在就覆盖,也可以什么都不做)
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
# Here's the license text for this file:
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# For more information, please refer to &http://unlicense.org/&
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
'-Wextra',
#'-Werror',
#'-Wc++98-compat',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-stdlib=libc++',
# THIS IS IMPORTANT! Without a "-std=&something&" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=&something&".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c++11',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-isystem',
'/usr/include',
'-isystem',
'/usr/local/include',
'-isystem',
'/Library/Developer/CommandLineTools/usr/include',
'-isystem',
'/Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1',
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
# Most projects will NOT need to
you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
final_flags.remove( '-stdlib=libc++' )
#except ValueError:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
'flags': final_flags,
'do_cache': True
此配置文件摘抄自 marchtea 的博客 , 被
编辑 .vimrc
gedit ~/.vimrc
复制粘贴到末尾
" 自动补全配置
set completeopt=longest,menu
"让Vim的补全菜单行为与一般IDE一致(参考VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自动关闭预览窗口
inoremap &expr& &CR&
pumvisible() ? "\&C-y&" : "\&CR&"
"回车即选中当前项
"上下左右键的行为 会显示其他信息
inoremap &expr& &Down&
pumvisible() ? "\&C-n&" : "\&Down&"
inoremap &expr& &Up&
pumvisible() ? "\&C-p&" : "\&Up&"
inoremap &expr& &PageDown& pumvisible() ? "\&PageDown&\&C-p&\&C-n&" : "\&PageDown&"
inoremap &expr& &PageUp&
pumvisible() ? "\&PageUp&\&C-p&\&C-n&" : "\&PageUp&"
"youcompleteme
s-tab 和自动补全冲突
"let g:ycm_key_list_select_completion=['&c-n&']
let g:ycm_key_list_select_completion = ['&Down&']
"let g:ycm_key_list_previous_completion=['&c-p&']
let g:ycm_key_list_previous_completion = ['&Up&']
let g:ycm_confirm_extra_conf=0 "关闭加载.ycm_extra_conf.py提示
let g:ycm_collect_identifiers_from_tags_files=1 " 开启 YCM 基于标签引擎
let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项
let g:ycm_cache_omnifunc=0
" 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_seed_identifiers_with_syntax=1
" 语法关键字补全
nnoremap &F5& :YcmForceCompileAndDiagnostics&CR&
"force recomile with syntastic
"nnoremap &leader&lo :lopen&CR& "open locationlist
"nnoremap &leader&lc :lclose&CR&
"close locationlist
inoremap &leader&&leader& &C-x&&C-o&
"在注释输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0
nnoremap &leader&jd :YcmCompleter GoToDefinitionElseDeclaration&CR& " 跳转到定义处
至此 VIM 的补全神器 YCM 安装完成,如果需要更加全面的配置方法,可以在 YCM 的
– zhongcq
– 萝卜特头
– 转自 marchtea
转载自(Mr_Zing)博客
读书不是为了让你富裕,而是让你沉着。读书不是为了让你看得见繁华,而是让你耐得住寂寞!
比较麻烦,未完待续。。。。。。 VIM 配置:.vimrc以及.ycm_extra_conf.py配置 插件:个人觉得以下几乎是必需的插件 插件列表: Vundle: 这个绝对是首先装好 nerdtree: 目录结构浏览 YouCompleteMe: 超级强大的自动补全,集...
LLVM 简介 LLVM 全称是 Low Level Virtual Machine,它是源自 the University of Illinois 的一个研究项目,该项目旨在提供一个现代化的编译机制,使得对任何编程语言既可以做到静态编译也可以动态编译,而且非常高效。后来 ...
工欲善其事,必先利其器,第一次从头开始打造自己的vim,特记录下流程~安装插件有:bundle, YouCompleteMe, NERDTree, TagList, winmanager 安装VIM因为要安装补全神器YouCompleteMe, 所以经历了好一番折腾,首先要...
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim.参考: https://github.com/Valloric/YouCompleteMe#full-inst...
真实有效的Vim配置记录(macOS) 以前在Ubuntu里配置了两次Vim,macOS中配置了一次,都没有配置成,一度放弃了Vim,安心地用Xcode,最近要开始准备省赛了,就抓紧重新配置了一下Vim。参考了一些不错的博客:从零搭建和配置OSX开发环境Vim中的杀手级插件...
早上起来赶公交,一路狂奔,还好司机叔叔看到我啦,哈哈,感谢感谢。 回归正轨喽,每一天都更努力一些吧。 目标时间:早上的上学路上。 我是将心动清单和平衡轮杂糅为一体,来做月度计划。这也是第一次做月计划,以后在磨合中再慢慢改进。 日计划就按照紧急,重要四象限来按序完成。 具体的...
忆江南烟雨醉蒙蒙 怡伊人之心意幽幽
同样一句话,从你(暂时未获得成功的人)口里说出来和从别人(已获得成功的人)口里说出来,说服力是天壤之别的。 从2016年底,在「得到」app里发现了李笑来老师的踪迹,一个付费的订阅专栏,《通往财富自由之路》。尽管名字很诱人,但我订阅的最大因素还是我对李笑来老师的崇拜之情吧!...
断舍离与一般的整理收纳术最大的区别就在于,断舍离并非绝对要以把房间弄干净为目的,而是要通过收拾的过程了解并喜欢上真实的自己,实现自我肯定感。总而言之,断舍离并不强求非得把房间收拾得规规矩矩一尘不染,或者即便如此,也会获得额外的好处。 其次,断舍离的主角不是物品,而是自己,考...
前天文中写的那位不幸的妈妈,除了有一个关于女儿的伤心教育故事,还有一个儿子的幸福教育故事。 今年,她的儿子读小学四年级。 拥挤的卧室里,他的小小床头上,放着一摞童书。 妈妈说:他妈妈反复说了好几遍,说:真是感谢当初你们在学校里,那样带着孩子读书。现在他真的养成了阅读的习惯,...博客分类:
文章转载自
周围的同事不喜欢使用 VIM 写 Python 代码的原因之一就是,VIM 不能像 Visual Studio 一样自动补全和提示。
其实,只是VIM 太低调,大家不知道而已。
这里介绍一下 python omni complete, 安装启用之后,是这个样子的:
1. 如何安装 'Python omni complete' plugin. 如果是VIM7.3,不需要再下载 pythoncomplete.vim 这个插件,因为安装时自带了。 但是, 必须保证编译安装 VIM 的时候启用了 Python 特性, 即
./configure --with-features=huge --enable-pythoninterp=yes
因为,pythoncomplete.vim 是用 python 写的。 我们可以在vim autoload 目录下看到
ls -la /usr/local/share/vim/vim73/autoload/
drwxr-xr-x
3 root root
-16 16:29 .
drwxr-xr-x 17 root root
-16 16:29 ..
-rw-r--r--
1 root root
-16 16:29 adacomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 ada.vim
-rw-r--r--
1 root root
-02-16 16:29 ccomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 csscomplete.vim
-rw-r--r--
1 root root
-16 16:29 decada.vim
-rw-r--r--
1 root root
-02-16 16:29 getscript.vim
-rw-r--r--
1 root root
-16 16:29 gnat.vim
-rw-r--r--
1 root root
-16 16:29 gzip.vim
-rw-r--r--
1 root root
-02-16 16:29 htmlcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 javascriptcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 netrwFileHandlers.vim
-rw-r--r--
1 root root
-16 16:29 netrwSettings.vim
-rw-r--r--
1 root root 1-02-16 16:29 netrw.vim
-rw-r--r--
1 root root
-16 16:29 paste.vim
-rw-r--r--
1 root root 1-02-16 16:29 phpcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 python3complete.vim
-rw-r--r--
1 root root
-02-16 16:29 pythoncomplete.vim
-rw-r--r--
1 root root
16:29 README.txt
-rw-r--r--
1 root root
-02-16 16:29 rubycomplete.vim
-rw-r--r--
1 root root
-16 16:29 spellfile.vim
-rw-r--r--
1 root root
-02-16 16:29 sqlcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 syntaxcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 tar.vim
-rw-r--r--
1 root root
-02-16 16:29 tohtml.vim
-rw-r--r--
1 root root
-02-16 16:29 vimball.vim
drwxr-xr-x
2 root root
-16 16:29 xml
-rw-r--r--
1 root root
-02-16 16:29 xmlcomplete.vim
-rw-r--r--
1 root root
-02-16 16:29 zip.vim
如果没有,则下载 pythoncomplete.vim, 并复制到 ~/.vim/autoload/ 目录下。 2. 如何启用自动补全 在 ~/.vimrc 中添加这样两行
filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Complete
此时,我们就完成了安装及配置工作。 3. 如何使用自动补全 例如我们输入
import sys
print sys.
此时, 按下 Ctrl+x, Ctrl+o, 就能看到提示列表框,以及对应的 docstring.
Ctrl+n, Ctrl+p 来上下选择 ESC 来取消提示框。
4. 不足之处
a. 属性没有 docstring, 只有函数有。
:( 这个似乎不好搞,因为属性似乎没有 docstring 这个概念。
b. 在没有下拉框的情况下,没有 docstring.
好在, pythoncomplete.vim 是 python 写的,有空大家可以自己完善一下。
浏览 33529
Zhongwei_leg
浏览: 402890 次
来自: 珠海
liuming 写道很好很强大。楼主有没有研究过LGPL协议和 ...
lich0079 写道filer'owner 不一定是什么vi ...
可以指变量,可以指构造方法。
一块可怜的牛皮糖 写道把数据分成256个表,然后对key的前两 ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'vim安装YouCompleteMe插件,与python补全插件jedi-vim
vim安装YouCompleteMe插件,与python补全插件jedi-vim
一.安装YouCompleteMe
1.安装vundle插件
~/.vim/bundle/vundle
2.安装YouCompleteMe
在.vimrc中添加:
Bundle ‘Valloric/YouCompleteMe’
然后进入vim,输入:
:BundleInstall
然后坐等安装……..
结束时有个错误,这是正常的,因为ycm需要手工编译出库文件
~/ .vim/bundle/YouCompleteMe && ./install.sh
期间好像有个报错,提示需要安装了cmake,根据提示安装即可.
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "2.6")
这个报错表示没有安装python-dev
执行sudo apt-get install python-dev即可。
安装完成后在.vimrc中添加如下配置
"youcompleteme
s-tab 和自动补全冲突
"let g:ycm_key_list_select_completion=['&c-n&']
let g:ycm_key_list_select_completion = ['&Down&']
"let g:ycm_key_list_previous_completion=['&c-p&']
let g:ycm_key_list_previous_completion = ['&Up&']
let g:ycm_confirm_extra_conf=0 "关闭加载.ycm_extra_conf.py提示
let g:ycm_collect_identifiers_from_tags_files=1 " 开启 YCM 基于标签引擎
let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项
let g:ycm_cache_omnifunc=0
" 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_seed_identifiers_with_syntax=1
" 语法关键字补全
nnoremap &F5& :YcmForceCompileAndDiagnostics&CR&
"force recomile with syntastic
"nnoremap &leader&lo :lopen&CR& "open locationlist
"nnoremap &leader&lc :lclose&CR&
"close locationlist
inoremap &leader&&leader& &C-x&&C-o&
"在注释输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0
安装jedi插件
1.安装jedi-vim
在.vimrc中添加:
Bundle ‘davidhalter/jedi-vim’
然后进入vim运行BundleInstall
2.安装jedi模块
sudo pip install jedi
gethub上的配置说明:
Jedi is by default automatically initialized. If you don’t want that I suggest you disable the auto-initialization in your .vimrc:
let g:jedi#auto_initialization = 0
There are also some VIM options (like completeopt and key defaults) which are automatically initialized, but you can skip this:
let g:jedi#auto_vim_configuration = 0
You can make jedi-vim use tabs when going to a definition etc:
let g:jedi#use_tabs_not_buffers = 1
If you are a person who likes to use VIM-splits, you might want to put this in your .vimrc:
let g:jedi#use_splits_not_buffers = “left”
This options could be “left”, “right”, “top”, “bottom” or “winwidth”. It will decide the direction where the split open.
Jedi automatically starts the completion, if you type a dot, e.g. str., if you don’t want this:
let g:jedi#popup_on_dot = 0
Jedi selects the first line of the completion menu: for a better typing-flow and usually saves one keypress.
let g:jedi#popup_select_first = 0
Jedi displays function call signatures in insert mode in real-time, highlighting the current argument. The call signatures can be displayed as a pop-up in the buffer (set to 1, the default), which has the advantage of being easier to refer to, or in Vim’s command line aligned with the function call (set to 2), which can improve the integrity of Vim’s undo history.
let g:jedi#show_call_signatures = “1”
Here are a few more defaults for actions, read the docs (:help jedi-vim) to get more information. If you set them to “”, they are not assigned.
NOTE: subject to change!
let g:jedi#goto_command = “d”
let g:jedi#goto_assignments_command = “g”
let g:jedi#goto_definitions_command = “”
let g:jedi#documentation_command = “K”
let g:jedi#usages_command = “n”
let g:jedi#completions_command = “”
let g:jedi#rename_command = “r”
Finally, if you don’t want completion, but all the other features, use:
let g:jedi#completions_enabled = 0
没有更多推荐了,}

我要回帖

更多关于 vim python3 自动补全 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信