开发工具 vim 插件和配置问题:rails.vim 插件不能使用

zlx_star · June 29, 2012 · Last by dfang replied at July 28, 2012 · 11316 hits

先问一句:rails.vim 是不是不能用 vundler 管理?

前提:我已经安装了 rails.vim

但是,当我用 vim 打开一个 rails 工程中的文件时,都会提示说 Disabling rails.vim: autoload/rails.vim is missing 并且 Rfind Rcd 等命令都不能使用。

另外,每次我打开/etc/vimrc文件时,都会有一些错误提示

Error detected while processing /etc/vimrc:
line   15:
E117: Unknown function: vundle#rc
line   18:
E492: Not an editor command: Bundle 'gmarik/vundle'
line   21:
E492: Not an editor command: Bundle "SuperTab"
line   22:
E492: Not an editor command: Bundle "taglist.vim"
line   24:
E492: Not an editor command: Bundle "ctrlp.vim"
line   25:
E492: Not an editor command: Bundle "rails.vim"
line   26:
E492: Not an editor command: Bundle "snipMate"
line   27:
E492: Not an editor command: Bundle "darkBlue"
line   29:
E492: Not an editor command: Bundle "http://github.com/scrooloose/nerdtree.git"

这些正好是 vundler 的配置命令,大家是怎么避免这种错误的?

/etc/vimrc 配置文件

f v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   set fileencodings=ucs-bom,utf-8,latin1
endif

set nocompatible                " Use Vim defaults (much better!)
set bs=indent,eol,start         " allow backspacing over everything in insert mode
set history=50                  " keep 50 lines of command line history
set ruler                       " show the cursor position all the time
set nu                          " set line number
color darkblue                  " set colorscheme
au GUIEnter * simalt ~x         " set full window
set modeline                    " set modeline on

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

" required!
Bundle 'gmarik/vundle'

" my bundles
Bundle "SuperTab"
Bundle "taglist.vim"
nnoremap <F8> :TlistToggle<CR>
Bundle "ctrlp.vim"
Bundle "rails.vim"
Bundle "snipMate"
Bundle "darkBlue"

Bundle "http://github.com/scrooloose/nerdtree.git"
nnoremap <F7> :NERDTreeToggle<CR>
nnoremap <F3> :NERDTree<CR>
let NERDTreeQuitOnOpen=0

filetype plugin indent on     " required!

bundle 的问题。装 bundle

@jinleileiking 我已经安装了,从配置文件可以看出来,这些插件都是在 vundler 管理下的。

#3 楼 @zlx_star 呢这个估计是 vundle 启动顺序不对,参考我的配置吧

@jinleileiking 你的什么配置啊? 顺便说,我也是天津的😄

建议刚上手 vim 最好用别人已经弄好的配置,然后慢慢熟悉之后再改造成自己想要的 vim 参考一下我的配置吧 https://github.com/HungYuHei/vimfiles

#6 楼 @HungYuHei 恩,不错,现在已经找了一个社区的牛人的配置。

@jinleileiking 天津有公司招 Ruby 程序员??????

@zlx_star 把你的 Bundle "rails.vim" 改为 Bundle "tpope/vim-rails" ,然后 BundleInstall 一下就好了

You need to Sign in before reply, if you don't have an account, please Sign up first.