首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ftplugin中声明的Vim插件不工作。

在ftplugin中声明的Vim插件不工作。
EN

Stack Overflow用户
提问于 2016-09-07 22:16:09
回答 1查看 1.4K关注 0票数 0

Gvim行为怪异我找不到原因。我使用Vundle,在我的.vimrc中声明的所有插件都正常工作。我在.vim/after/ftplugin/java.vim中声明了一些额外的设置和插件。

映射工作良好,但插件不起作用。如果我在当前的gvim会话中选择了另一个文件,则会收到以下错误消息:

代码语言:javascript
复制
Error detected while processing function vundle#config#bundle[2]..<SNR>14_check_bundle_name:
line 2:
Vundle error: Name collision for Plugin Raimondi/delimitMate. Plugin Raimondi/delimitMate previously used the name "delimitMate". Skipping Plugin Raimondi/delimitMate.
Vundle error: Name collision for Plugin artur-shaik/vim-javacomplete2...
[comment: same error message for all plugins declared in the ftplugin]

我注意到,如果我运行:VundleInstall,插件就会突然正常工作(当我更改文件时,错误信息会保留,当我使用命令时没有安装插件)。

这里是我的.vimrc的开始

代码语言:javascript
复制
syntax on
set guifont=Inconsolata\ Medium\ 12
set nocompatible
set t_Co=256

filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

"[comment: all plugins I use for every filetype]

call vundle#end()            " required

filetype plugin indent on

这是我的java.vim文件:

代码语言:javascript
复制
filetype off
"to automatically close brackets
Plugin 'Raimondi/delimitMate'

"omni-complete for Java
Plugin 'artur-shaik/vim-javacomplete2'

"use tab to navigate through insert completion
Plugin 'ervandew/supertab'
filetype plugin indent on

"needed to make javacomplete2 working properly
autocmd FileType java setlocal omnifunc=javacomplete#Complete

我的操作系统是Ubuntu16.04。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-09-08 05:27:36

所有:Plugin命令都应该位于这两行之间:

代码语言:javascript
复制
call vundle#begin()

" :Plugin commands go here

call vundle#end() 

如果您绝对需要延迟加载,请尝试另一个插件管理器

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

https://stackoverflow.com/questions/39379822

复制
相关文章

相似问题

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