为Ruby on Rails设置Vim

时间:2023-01-29 23:31:05

I work with Ruby on Rails and wish to use vim as the editor of choice. However, I can't find anywhere simple set of step by step,idiot proof, instructions with well explained steps as to how to set it up properly.

我使用Ruby on Rails,并希望使用vim作为编辑器。然而,我在任何地方都找不到一套简单的步骤,愚蠢的证明,有详细说明的步骤如何设置它。

I wish to set vim properly, with nice plugins link vim for rails, nerdtree and stuff like that. Please help me, I would be most grateful.

我希望正确地设置vim,使用漂亮的插件链接vim来连接rails、nerdtree等等。请帮助我,我将非常感激。

So far I have installed RoR, vim, and git.

到目前为止,我已经安装了RoR、vim和git。

5 个解决方案

#1


5  

You're probably not going to find "idiot proof" anything when it comes to vim. However, the good news is that it's really not that hard once you do it a few times. If you can get NERD tree installed, that's a good pattern for every other vim plugin out there.

当涉及到vim时,你可能找不到任何“白痴证据”。然而,好消息是,一旦你这样做了几次,就不会那么困难了。如果你可以安装NERD tree,这对于其他所有vim插件来说都是一个很好的模式。

The instructions for that plugin are simple enough.

这个插件的说明非常简单。

Unzip the archive into your ~/.vim directory. That should put NERD_tree.vim in ~/.vim/plugin and NERD_tree.txt in ~/.vim/doc.

解压档案到你的~/。vim目录。应该把NERD_tree。在~ / vim。vim /插件和NERD_tree。txt ~ / .vim /医生。

You don't really need any plugins to work with Ruby in vim, but the short list of plugins that I use regularly are:

在vim中使用Ruby并不需要任何插件,但是我经常使用的插件列表如下:

  • bufexplorer -- Easily the one that I use most often. Hundreds of times daily.
  • bufexplorer——我最常用的那种。每天数百次。
  • NERD Commenter
  • 书呆子评论者
  • NERD tree
  • 书呆子树
  • rails
  • rails

Of those, the one that I use the most has nothing to do with Ruby specifically, but I find it to be faster than checking :ls for a buffer number. As long as I have bufexplorer plugged in, and ack installed on the system, I'm ready to slay some Ruby code. The other plugins are just "nice-to-haves".

其中,我使用最多的一个与Ruby无关,但我发现它比检查:ls作为缓冲区号要快。只要我安装了bufexplorer,并在系统上安装了ack,我就可以删除一些Ruby代码。其他的插件只是“友好的”。

#2


7  

I was fiddling around with vim plugins as well, then I found out, that janus fits my needs quite well. It has a bunch of plugins I use regularily, like Ack.vim, NERDtree and SuperTab. And it is easy to install:

我也在摆弄vim插件,然后我发现janus非常适合我的需要。它有很多我经常使用的插件,比如Ack。vim,NERDtree SuperTab。安装方便:

curl -Lo- http://bit.ly/janus-bootstrap | bash

I am not sure, if rails.vim is included or if I installed it myself. Check it out. Maybe it fits your needs.

我不确定,如果rails。vim包括在内,如果我自己安装的话。检查出来。也许它适合你的需要。

#3


2  

There's also vim-ruby, vim-rake & vim-rvm to help you along too.

也有vim-ruby、vim-rake和vim-rvm来帮助您。

You could also consider using the duo of Pathogen & Vundle for auto installation. Pathogen was written by Tim Pope who wrote vim-rails. His Fugitive Git wrapper is invaluable also when using Git for source control for your Rails projects.

你也可以考虑使用双病原体和Vundle进行自动安装。病原体是由写vim-rails的Tim Pope写的。当使用Git对Rails项目进行源代码控制时,他的逃亡Git包装器也是非常宝贵的。

#4


0  

Installing vim-rails using pathogen (recommended)

使用病原体安装vim-rails(推荐)

Copy and paste:

复制和粘贴:

mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

If you're using Windows, change all occurrences of ~/.vim to ~\vimfiles.

如果您正在使用Windows,请更改所有出现的~/。~ \ vimfiles vim。

Add this to your vimrc:

将此添加到vimrc:

execute pathogen#infect()

执行病原体感染()号

If you're lacking a vimrc, vim ~/.vimrc and paste:

如果你缺少vimrc, vim ~/。vimrc粘贴:

execute pathogen#infect()
syntax on
filetype plugin indent on

Now any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the 'runtimepath'. Observe:

现在,您希望安装的任何插件都可以提取到~/下的子目录中。vim/bundle,它们将被添加到“运行时路径”中。观察:

cd ~/.vim/bundle
git clone git://github.com/tpope/vim-rails.git
git clone git://github.com/tpope/vim-bundler.git

AND/OR

和/或

Install Janus (includes some of the most popular vim plugins)

安装Janus(包括一些最流行的vim插件)

curl -Lo- https://bit.ly/janus-bootstrap | bash

旋度lo - https://bit。ly / janus-bootstrap | bash

Resources:

资源:

#5


0  

Check out this bundle I created for Vim - smolnar/vim-rails-bundle. Might help setting up your environment.

看看我为Vim - smolnar/ Vim -rail -bundle创建的这个bundle。可能有助于建立您的环境。

#1


5  

You're probably not going to find "idiot proof" anything when it comes to vim. However, the good news is that it's really not that hard once you do it a few times. If you can get NERD tree installed, that's a good pattern for every other vim plugin out there.

当涉及到vim时,你可能找不到任何“白痴证据”。然而,好消息是,一旦你这样做了几次,就不会那么困难了。如果你可以安装NERD tree,这对于其他所有vim插件来说都是一个很好的模式。

The instructions for that plugin are simple enough.

这个插件的说明非常简单。

Unzip the archive into your ~/.vim directory. That should put NERD_tree.vim in ~/.vim/plugin and NERD_tree.txt in ~/.vim/doc.

解压档案到你的~/。vim目录。应该把NERD_tree。在~ / vim。vim /插件和NERD_tree。txt ~ / .vim /医生。

You don't really need any plugins to work with Ruby in vim, but the short list of plugins that I use regularly are:

在vim中使用Ruby并不需要任何插件,但是我经常使用的插件列表如下:

  • bufexplorer -- Easily the one that I use most often. Hundreds of times daily.
  • bufexplorer——我最常用的那种。每天数百次。
  • NERD Commenter
  • 书呆子评论者
  • NERD tree
  • 书呆子树
  • rails
  • rails

Of those, the one that I use the most has nothing to do with Ruby specifically, but I find it to be faster than checking :ls for a buffer number. As long as I have bufexplorer plugged in, and ack installed on the system, I'm ready to slay some Ruby code. The other plugins are just "nice-to-haves".

其中,我使用最多的一个与Ruby无关,但我发现它比检查:ls作为缓冲区号要快。只要我安装了bufexplorer,并在系统上安装了ack,我就可以删除一些Ruby代码。其他的插件只是“友好的”。

#2


7  

I was fiddling around with vim plugins as well, then I found out, that janus fits my needs quite well. It has a bunch of plugins I use regularily, like Ack.vim, NERDtree and SuperTab. And it is easy to install:

我也在摆弄vim插件,然后我发现janus非常适合我的需要。它有很多我经常使用的插件,比如Ack。vim,NERDtree SuperTab。安装方便:

curl -Lo- http://bit.ly/janus-bootstrap | bash

I am not sure, if rails.vim is included or if I installed it myself. Check it out. Maybe it fits your needs.

我不确定,如果rails。vim包括在内,如果我自己安装的话。检查出来。也许它适合你的需要。

#3


2  

There's also vim-ruby, vim-rake & vim-rvm to help you along too.

也有vim-ruby、vim-rake和vim-rvm来帮助您。

You could also consider using the duo of Pathogen & Vundle for auto installation. Pathogen was written by Tim Pope who wrote vim-rails. His Fugitive Git wrapper is invaluable also when using Git for source control for your Rails projects.

你也可以考虑使用双病原体和Vundle进行自动安装。病原体是由写vim-rails的Tim Pope写的。当使用Git对Rails项目进行源代码控制时,他的逃亡Git包装器也是非常宝贵的。

#4


0  

Installing vim-rails using pathogen (recommended)

使用病原体安装vim-rails(推荐)

Copy and paste:

复制和粘贴:

mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

If you're using Windows, change all occurrences of ~/.vim to ~\vimfiles.

如果您正在使用Windows,请更改所有出现的~/。~ \ vimfiles vim。

Add this to your vimrc:

将此添加到vimrc:

execute pathogen#infect()

执行病原体感染()号

If you're lacking a vimrc, vim ~/.vimrc and paste:

如果你缺少vimrc, vim ~/。vimrc粘贴:

execute pathogen#infect()
syntax on
filetype plugin indent on

Now any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the 'runtimepath'. Observe:

现在,您希望安装的任何插件都可以提取到~/下的子目录中。vim/bundle,它们将被添加到“运行时路径”中。观察:

cd ~/.vim/bundle
git clone git://github.com/tpope/vim-rails.git
git clone git://github.com/tpope/vim-bundler.git

AND/OR

和/或

Install Janus (includes some of the most popular vim plugins)

安装Janus(包括一些最流行的vim插件)

curl -Lo- https://bit.ly/janus-bootstrap | bash

旋度lo - https://bit。ly / janus-bootstrap | bash

Resources:

资源:

#5


0  

Check out this bundle I created for Vim - smolnar/vim-rails-bundle. Might help setting up your environment.

看看我为Vim - smolnar/ Vim -rail -bundle创建的这个bundle。可能有助于建立您的环境。