开发者

vim and Ruby on Rails [closed]

开发者 https://www.devze.com 2023-02-18 06:27 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow ques开发者_Python百科tions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago.

Improve this question

I have got Mac on work, Ubuntu on my notebook, CentOS on my server, Windows at my girlfriend place and my VM. I used to work on gMate (Ubuntu) that is very good and not far from TextMate (on my Mac), e.texteditor (Windows) and nano on CentOs. Now I want to install one editor for all my environments. I can choose vim or emacs. I think vim is more simple to manage :).

I know that there are a bunch of rails castomizations (plugins): from Akita, scrooloose, Pope etc. I've tasted all of them sometime ago. All of them was buggy (I think the problem is in my hands).

So what I really need now is to choose one plugin which is simple to install.

And second big deal is set of your favorite vim commands like:

  • Open folder as project (and open the folder as project and exclude some subfolders from public dir)
  • Fast open file from my project
  • Open reffering controller/model/helper/etc
  • Extract partial
  • Using snippets
  • Code autocomplete
  • Rails console / Terminal / Git support
  • Working with tabs

and other useful stuff from *Mates.

And I want to set vim face: like file manager on the left, console on the bottom etc. What should I do for it.

After bounty: Thanks to everybody! Going to win the vim!


Edit: Actually someone already mentioned janus, but I am leaving this up because it has more info on what janus is.

I am a bit surprised no one has mentioned the vim 'distribution' Janus yet:

https://github.com/carlhuda/janus

Named after the God of Beginnings and Ends, it includes many of the plugins that people have mentioned above. While I don't use it myself it gets high marks from co-workers who are now former textmate users. Frankly if I didn't already have so much invested in my own vim configuration I would totally use it.

It is really oriented at Ruby/Rails developers switching from Textmate to vim. It has things like the command t(find file) and the project drawer bound to the commands you are already familiar with from Textmate.

Janus is sort of like a gateway drug to vim really. It gets you comfortable with familiarity from Textmate then blows your mind with vim's power.

It is very easy to install on linux(gvim) and osx(MacVim), however I am not sure how it would run on windows.

Now go enjoy vim. :)

Edit: You mentioned you would like a terminal split as well, Janus includes the ConqueTerm plugin bound to command e for opening a terminal.


rails.vim for:

  • Open reffering controller/model/helper/etc
  • Extract partial
  • Rails console (calling scripts easily)
  • Code autocomplete

snipmate.vim for:

  • Using snippets

project.vim for:

  • Open folder as project (and open the folder as project and exclude some subfolders from public dir)

command-t.vim for:

  • Fast open file from my project

fugitive.vim for:

  • Git support

pathogen.vim for managing all those plugins!


You might want to try out the .vimrc files of Carl Huda's janus


I forked this at Github when I was getting started developing ruby apps using vim. Then I decided to maintain my own files.

https://github.com/akitaonrails/vimfiles

It has Tim's plugins, Nerd tree, Command-T, snipmate, fugitive, rails and a lot more besides.

It is maintained to support win, linux and mac users.

Here is the original article that got me interested.

http://www.akitaonrails.com/2009/04/27/the-best-environment-for-rails-on-windows-part-2


And include VIM ruby debugger in your list. Its very handy.


I don't do Ruby but here are the plugins I use:

  • autocomple: AutoComplPop or the native omnicomplete: <C-x><C-o> etc.
  • snippets: SnipMate
  • opening files (+ buffer switching + buffer search): LustyJuggler
  • git: fugitive or vcscommand

These plugins/native functionnalities might fit your other needs but I don't use them:

  • project: project
  • open controller…: ctags & ctrl+] (see this answer for more). I think Tim Pope's rails.vim has that kind of thing but more ruby-like.


I recommend you use Vundle from the beginning, and save yourself the trouble of manually installing Vim plugins. It is much cleaner than Pathogen imho -- like a Vim package manager. That makes trying different plugins to see what you like a lot easier.

Edit: Btw, here is my own vim configuration.

0

精彩评论

暂无评论...
验证码 换一张
取 消