[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

vim-ruby broken?

Brian Schröder

4/27/2005 9:35:00 AM

Hello group,

Following all the discussion on vim here recently, I wanted to try it
out. First thing was checking the vim page on ruby-garden and trying
to install vim-ruby. But here I already am stuck. What I did:

silver:~# gem install vim-ruby
Config file /root/.gemrc does not exist
Attempting local installation of 'vim-ruby'
Local gem file not found: vim-ruby*.gem
Attempting remote installation of 'vim-ruby'
Successfully installed vim-ruby, version 2004.09.20
Installing RDoc documentation for vim-ruby-2004.09.20...
silver:~# vim-ruby-install.rb
: No such file or directory

Same thing if I try the tar.gz aproach.

I'm using debian with a 2.6 kernel and ruby 1.8.2 (2005-04-11).

best regards,

Brian Schröder

--
http://ruby.brian-sch...

multilingual _non rails_ ruby based vocabulary trainer:
http://www.vocabu... | http://www.g... | http://www.vok...



16 Answers

Tilman Sauerbeck

4/27/2005 5:06:00 PM

0

Brian Schröder <ruby.brian@gmail.com> [2005-04-27 18:34]:

Hi,

> Following all the discussion on vim here recently, I wanted to try it
> out. First thing was checking the vim page on ruby-garden and trying
> to install vim-ruby. But here I already am stuck. What I did:

The Vim releases already contain syntax/indent files for Ruby, so you
probably don't have to install the latest vim-ruby release to enjoy Ruby
support in Vim.

Cannot help you with the installation failure, I'm using the one that
ships with Vim, and copied the syntax file to ~/.vim/syntax to get some
minor fixes :)

--
Regards,
Tilman


Joe Van Dyk

4/27/2005 6:15:00 PM

0

On 4/27/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> Brian Schröder <ruby.brian@gmail.com> [2005-04-27 18:34]:
>
> Hi,
>
> > Following all the discussion on vim here recently, I wanted to try it
> > out. First thing was checking the vim page on ruby-garden and trying
> > to install vim-ruby. But here I already am stuck. What I did:
>
> The Vim releases already contain syntax/indent files for Ruby, so you
> probably don't have to install the latest vim-ruby release to enjoy Ruby
> support in Vim.
>
> Cannot help you with the installation failure, I'm using the one that
> ships with Vim, and copied the syntax file to ~/.vim/syntax to get some
> minor fixes :)

Doesn't vim-ruby embed a ruby interpreter into vim? So you can run
small ruby scripts on whatever you're editing? Or am I thinking of
something else?



Stefan Lang

4/27/2005 6:52:00 PM

0

On Wednesday 27 April 2005 20:15, Joe Van Dyk wrote:
> On 4/27/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> > Brian Schröder <ruby.brian@gmail.com> [2005-04-27 18:34]:
> >
> > Hi,
> >
> > > Following all the discussion on vim here recently, I wanted to try it
> > > out. First thing was checking the vim page on ruby-garden and trying
> > > to install vim-ruby. But here I already am stuck. What I did:
> >
> > The Vim releases already contain syntax/indent files for Ruby, so you
> > probably don't have to install the latest vim-ruby release to enjoy Ruby
> > support in Vim.
> >
> > Cannot help you with the installation failure, I'm using the one that
> > ships with Vim, and copied the syntax file to ~/.vim/syntax to get some
> > minor fixes :)
>
> Doesn't vim-ruby embed a ruby interpreter into vim? So you can run
> small ruby scripts on whatever you're editing? Or am I thinking of
> something else?

This feature comes with the vim source distribution. You just have to
enable it when you run configure. It also provides a Ruby API for vim.
Type
:h ruby

Stefan



Brian Schröder

4/27/2005 8:52:00 PM

0

On 27/04/05, Stefan Lang <langstefan@gmx.at> wrote:
> On Wednesday 27 April 2005 20:15, Joe Van Dyk wrote:
> > On 4/27/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> > > Brian Schröder <ruby.brian@gmail.com> [2005-04-27 18:34]:
> > >
> > > Hi,
> > >
> > > > Following all the discussion on vim here recently, I wanted to try it
> > > > out. First thing was checking the vim page on ruby-garden and trying
> > > > to install vim-ruby. But here I already am stuck. What I did:
> > >
> > > The Vim releases already contain syntax/indent files for Ruby, so you
> > > probably don't have to install the latest vim-ruby release to enjoy Ruby
> > > support in Vim.
> > >
> > > Cannot help you with the installation failure, I'm using the one that
> > > ships with Vim, and copied the syntax file to ~/.vim/syntax to get some
> > > minor fixes :)
> >
> > Doesn't vim-ruby embed a ruby interpreter into vim? So you can run
> > small ruby scripts on whatever you're editing? Or am I thinking of
> > something else?
>
> This feature comes with the vim source distribution. You just have to
> enable it when you run configure. It also provides a Ruby API for vim.
> Type
> :h ruby
>
> Stefan
>
>

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
2) Execute ruby file in another frame with F5
3) Manage multiple buffers comfortably
I will have to stick to xemacs. Though it seems to me that the most
common commands are in the standard setting better "huffmann coded"
than the emacs variants.

best regards,

Brian

--
http://ruby.brian-sch...

multilingual _non rails_ ruby based vocabulary trainer:
http://www.vocabu... | http://www.g... | http://www.vok...



Tilman Sauerbeck

4/27/2005 9:51:00 PM

0

Brian Schröder <ruby.brian@gmail.com> [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

--
learn to quote: http://www.netmeister.org/news/learn2...


Stefan Lang

4/27/2005 10:01:00 PM

0

On Wednesday 27 April 2005 22:52, Brian Schröder wrote:
> 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

These lines in your ~/vimrc should do it:
set smarttab
set sw=4 " replace 4 with whatever you like

Stefan



Brian Schröder

4/27/2005 10:08:00 PM

0

On 27/04/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> Brian Schröder <ruby.brian@gmail.com> [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.

best regards,

Brian

PS: I'm not shure if this is the right group to discuss this as it is
only marginally connected to ruby, if somebody is annoyed please speak
up or ignore the thread.
--
http://ruby.brian-sch...

multilingual _non rails_ ruby based vocabulary trainer:
http://www.vocabu... | http://www.g... | http://www.vok...



Tilman Sauerbeck

4/27/2005 10:23:00 PM

0

Brian Schröder <ruby.brian@gmail.com> [2005-04-28 07:08]:
> On 27/04/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> > Brian Schröder <ruby.brian@gmail.com> [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 <TAB> <ESC>==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 <TAB> ==

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/learn2...


Joe Van Dyk

4/27/2005 10:32:00 PM

0

On 4/27/05, Brian Schröder <ruby.brian@gmail.com> wrote:
> On 27/04/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> > Brian Schröder <ruby.brian@gmail.com> [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.

Generally in vim, stuff just automatically indents itself correctly.
If I type an "end", it'll put it in the correct place. No need to
manually press tab or anything.



Luke Graham

4/28/2005 2:57:00 AM

0

On 4/28/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
> On 4/27/05, Brian Schröder <ruby.brian@gmail.com> wrote:
> > On 27/04/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
> > > Brian Schröder <ruby.brian@gmail.com> [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.
>
> Generally in vim, stuff just automatically indents itself correctly.
> If I type an "end", it'll put it in the correct place. No need to
> manually press tab or anything.

Another way to do it is to use visual mode to highlight what you want,
then press = (once or twice, my brain cant remember but my fingers
do :)

--
spooq