On Nov 28, 2007 10:56 AM, ara.t.howard <ara.t.howard / gmail.com> wrote:
>
>
> On Nov 28, 2007, at 8:29 AM, Christian von Kleist wrote:
>
> > I don't use GVim because it doesn't work inside screen, but yes, Vim
> > and GVim both do tabs.  Try `:help tab-page-intro` to get an overview.
> >
> > The basic commands are:
> >
> > :tabnew -> open a new tab
> > :tabedit index.rhtml (or :tabe index.rhtml) -> open file index.rhtml
> > in a new tab
> > :tabclose (or :tabc) -> close current tab
> > :tabmove 4 (or :tabm 4) -> move current tab after tab 4
> >
> > gt (or :tabnext) -> next tab
> > gT (or :tabprevious) -> previous tab
> > 4gt -> go to tab 4
> >
> > The excellent and indispensable rails.vim plugin has some nice tab
> > support features.
> >
> > I'm not sure if OS X Vim has tab support by default...
>
> well i'll be...
>
> very cool!
>
> that's the other great thing about vim - it takes a lifetime to learn
> it all.
>
> 'gT' is pretty dang awkward for flipping though - i think i might map
> 'tn' (tabnext) and 'tp' (tabprevious)
>
> otherwise this might be my new favorite vim feature.
>
>
> cheers.
>
> a @ http://codeforpeople.com/
> --
> we can deny everything, except that we have the possibility of being
> better. simply reflect on that.
> 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.