From: Tilman Sauerbeck Date: 2005-04-28T07:22:39+09:00 Subject: Re: vim-ruby broken? Brian Schr�der [2005-04-28 07:08]: > On 27/04/05, Tilman Sauerbeck wrote: > > Brian Schr�der [2005-04-28 05:52]: > > > Thank you all for your answers. I can imagine that vim is not too bad, > > > after having tried it a bit. But until I find time to find out how to > > > do: > > > 1) Auto-Indent with Tab > > > > set sw=4 " no of spaces for indentation > > set ts=4 " show \t as 4 spaces resp treat 4 spaces as a tab when > > " deleting etc > > set sts=0 " forgot what this sucker did ;) > > set noexpandtab " don't expand tabs to spaces > > > > Thanks for the fast reply, but I meant pressing tab to indent a line > to the semantically correct level. Xemacs does a great job for ruby > code. imap ==i This adds a mapping for input mode (imap), which remaps tab to escape (go to command mode). Then it executes ==, which reindets the current line, and goes back to insert mode. map == This would make tab reindent the current line when in command mode. When you combine this with an autocommand, you can make vim only use these mappings when you're in Ruby mode :) Or you could put them in a filetype plugin. -- learn to quote: http://www.netmeister.org/news/learn2quote.html