您好,Stack Overflow vim用户,我最近发现自己花了相当多的时间在我学校的计算机科学实验室编写代码.我已经在无数的Linux系统上配置了vim,并且从未遇到过这个错误:
E499: Empty file name for '%' or '#', only works with ":p:h"
Run Code Online (Sandbox Code Playgroud)
在vim中的命令中使用%时,会发生此错误.我以前从未见过这个,但我会尽可能多地提供信息.这是我的.vimrc:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
"Plugin 'scrooloose/nerdtree'
"Plugin 'bling/vim-airline'
"Plugin 'altercation/vim-colors-solarized'
call vundle#end()
filetype plugin indent on
Run Code Online (Sandbox Code Playgroud)
我已经注释掉了最后几个插件,看看它们是否与错误有任何关联,但这似乎没有帮助.我像往常一样使用Git安装vim:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Run Code Online (Sandbox Code Playgroud)
之后我所做的就是运行:PluginInstall来安装插件,然后尝试使用:source%,导致错误.
这真是难倒我了,我希望能解决这个问题,因为我想用我定制的vim设置这个CS类,但我可以处理股票VIM甚至六,或者如果它涉及到它...纳米.
编辑:使用Ubuntu 15.04
vim ×1