On Nov 28, 2007 10:56 AM, ara.t.howard [email protected] wrote:
:tabedit index.rhtml (or :tabe index.rhtml) → open file index.rhtml
‘tn’ (tabnext) and ‘tp’ (tabprevious)
h.h. the 14th dalai lama
Yep, I’ve been using Vim/vi since 1998 in my first college C class,
and I’m still learning new stuff about it! There are so many great
plugins out there, like Nerd_commenter.vim, rails.vim, taglist.vim,
etc…
I could hardly get by in day-to-day Rails coding without rails.vim,
which has ‘gf’. You can put the cursor over almost anything and do
‘gf’ to go to that thing. Here are some examples from the rails.vim
doc:
(* indicates cursor position)
Pos*t.find(:first)
app/models/post.rb
has_many :c*omments
app/models/comment.rb
link_to "Home", :controller => :bl*og
app/controllers/blog_controller.rb
<%= render :partial => 'sh*ared/sidebar' %>
app/views/shared/_sidebar.rhtml
<%= stylesheet_link_tag :scaf*fold %>
public/stylesheets/scaffold.css
class BlogController < Applica*tionController
app/controllers/application.rb
class ApplicationController < ActionCont*roller::Base
…/action_controller/base.rb
fixtures :pos*ts
test/fixtures/posts.yml
layout :pri*nt
app/views/layouts/print.rhtml
# In the Blog controller
def li*st
app/views/blog/list.rhtml
<%= link_to "New", new_comme*nt_path %>
app/controllers/comments_controller.rb (jumps to def new)
You also get the :A and :R commands which jump from the current file
to the (A)lternate or (R)elated file:
Current file Alternate file Related file
model unit test related migration
controller (in method) functional test template (view)
template (view) helper controller (jump to method)
migration previous migration next migration
config/routes.rb config/database.yml config/environment.rb
As I said, Ruby/RoR + Vim is heaven.