开发者

What components make VIM a good (great) ruby editor?

开发者 https://www.devze.com 2023-01-17 16:33 出处:网络
I\'m learning ruby on rails on a linux box and dusting off my VIM skills (skillz?). When I got started on VIM way back in my c++ days, I had a friend with a great vimfiles folder that had tons of s

I'm learning ruby on rails on a linux box and dusting off my VIM skills (skillz?).

What components make VIM a good (great) ruby editor?

When I got started on VIM way back in my c++ days, I had a friend with a great vimfiles folder that had tons of stuff to get started. Starting from scratch, vim is great, but it feels like it could be a lot better.

I currently have开发者_StackOverflow社区:

  • vim-ruby
  • buffer explorer
  • xml-edit (though I don't have it currently working with erb files)

I know that barely scratches the surface of what some more experienced vim/ruby devs have (including the one offs in the vim.rc file).

Is there a list somewhere (or could we create one) of a bunch of the standard vim configurations needed to make programming ruby (and rails) more fun? Is there a zip/tarball somewhere with a good base setup?


take a look at tim pope's repos on git hub. Many, many awesome vim plugins and extensions for working with ruby and rails

http://github.com/tpope


snipMate (GitHub repo) is highly recommended. It enables you to use TextMate-style snippets in Vim.

snipMate is not Ruby-specific: by default, it comes with one file containing Ruby-specific snippets. If you are going to work a lot on Ruby-based code (Rails, RSpec, Shoulda, and the like), it's probably better to use one of the available snippets' collections and customize it as you see fit rather than writing your own snippets from scratch.


There is a pretty nice setup for your VIM environment.

http://github.com/akitaonrails/vimfiles

Just follow the instructions and in a minute or two you will have everything ready for Ruby(on Rails) development.

As Jed has mentioned above - tpope plugin is a "must have" and it is part of the akita vimfiles.


I have this in my ~/.vimrc to quickly see the output of a file I'm working on:

map <Leader>r :w! <bar> !ruby %<CR>

For rails, two essential plugins are rails.vim and the NERD tree, for navigating the directory of the rails project you're working on.

0

精彩评论

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

关注公众号