Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
157 lines (103 sloc) 4.1 KB

介绍

这是经典的vim on rails开发工具

安装

请确保您已经安装了git-core,vim-7.2,ruby,rvm

sudo apt-get install exuberant-ctags ncurses-term

git clone git://github.com/saberma/vimfiles.git ~/.vim

#初始化插件
cd ~/.vim
git submodule init
git submodule update
ln -s ~/.vim/vimrc ~/.vimrc

cd ~/.vim/bundle/Command-T/ruby/command-t
#一定要先切换回ruby1.8.7,否则vim会报错:Vim: Caught deadly signal SEGV 
rvm system
ruby extconf.rb
make
rvm default

注意

最新版本的rails vimfiles已经不再使用fuzzy_finder实现快速打开文件的功能,而改用CommandT
其快捷键也由原来的ctrl + t 改为 leader + t,leader键即\键

外部新增文件后,CommandT列表中看不到时,需要手动输入:CommandTFlush,刷新缓存

参考资源

使用说明参考这里

技术互助

有需要帮助或交流的地方,可以:

  1. 加我的gtalk直接沟通: mahb45#gmail.com
  2. 发送email: mahb45#gmail.com

以下为详细说明:

Vim

It is recommended that you use gVim in either Windows or Linux and MacVim for
Mac. Download from:

Usage

Troubleshoot: Because of the large amount of submodules, if you ever have any
trouble after pulling from the repository, it will be easier to just back up
your old .vim folder and just git clone a new version.

Clone this repo into your home directory either as .vim (linux/mac) or
vimfiles (Windows). Such as:


git clone git://github.com/akitaonrails/vimfiles.git ~/.vim

Then ‘cd’ into the repo and run this to get the snippets submodule:


git submodule init
git submodule update

Now just copy (or symlink) the .vim/vimrc file as .vimrc (Mac/Linux)
or copy as _vimrc (Windows) in your home directory. In Mac and Linux, the
easiest thing to do is:


ln -s ~/.vim/vimrc ~/.vimrc

If you already have a custom .vimrc file, append the following lines to
load everything else along with your personal hacks:


source ~/.vim/vimrc      "linux
source ~/vimfiles/vimrc  "windows

Help Tags

At first usage of vim, type “:” while in command mode and execute:

call pathogen#helptags()

This will make the plugins documentations available upon :help

Dependencies

You will need these dependencies figured out:

In Ubuntu, for example, you will have to do:


apt-get install exuberant-ctags ncurses-term

On Windows you have to download Ctags and add ctags.exe in your PATH.

Mac OS X and most Linux distros come with Ruby already. If you’re in Windows
look for Luis Lavena’s latest Ruby Installer (http://rubyforge.org/projects/rubyinstaller/)

IMPORTANT: Command-T

The latest version replaces the old Fuzzy Finder with a new one called
“Command-T” form wincent.com. I’ve replaced the old “Command-T” key
binding that used to open new tabs and assigned it to this new plugin
so it behaves the same as Textmate.

You may have problems in Mac/Linux because this plugin requires a native
extension, so you will have to do this:


cd ~/.vim/bundle/Command-T/ruby/command-t
ruby extconf.rb
make

This means that you need to have your Ruby source files and GCC also
installed. A binary for Windows is already bundled so it should just
work. I’ve also included a binary compiled for Ruby Enterprise Edition,
but if you are using other Ruby distros, you will need to recompile.

Learn Vim

Visit the following sites to learn more about Vim:

There are many sites teaching Vim, if you know of any other that are easy
to follow for newcomers, let me know.

Credits

  • Original project and most of the heavy lifting: @scrooloose
  • All the cool plugins for Rails, Cucumber and more: @timpope
  • Great Command-T plugin by: Wincent
  • Hacks and some snippets: @akitaonrails