vim-ruby broken?

B

Brian Schröder

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
 
T

Tilman Sauerbeck

Brian Schröder <[email protected]> [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 :)
 
J

Joe Van Dyk

Brian Schröder <[email protected]> [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?
 
S

Stefan Lang

Brian Schröder <[email protected]> [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
 
B

Brian Schröder

Brian Schröder <[email protected]> [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
 
T

Tilman Sauerbeck

Brian Schröder said:
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
 
S

Stefan Lang

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
 
B

Brian Schröder

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.
 
T

Tilman Sauerbeck

Brian Schröder said:
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.
 
J

Joe Van Dyk

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.
 
L

Luke Graham

Brian Schröder <[email protected]> [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 :)
 
A

Andrew Walrond

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:
3) Manage multiple buffers comfortably

:split or :vsplit fragments the window in obvious ways

Ctrl-w Ctrl-w moves between the windows (There are more specific directional
commands, but this is easiest)

:b <name> selects a different buffer in the current window

:buffers gives a list of the available buffers

There is much more, but this would get you started.

To give VIM a chance, you'll need a day.
-Do the tutor exercise
-Read the User part of the manual (not reference)

play for a while, then read the manual again. It will make sense when you
understand the basics.

Eg:
gg=G

starts off as an undecipherable hard to remember command, until it dawns on
you that
gg goes to the top of the buffer
= reindents
G goes to the bottom of the buffer

Thereby reindenting the whole file

Andrew Walrond
 
B

Brian Schröder

softtabstop if non-zero, number of spaces to insert for a <Tab>
(local to buffer)
set sts=0

Thanks everybody for your answers. The good thing about editor wars is
that everybody is incredible helpfull if someone wants to try out
their "fetisch" ;)

I'll give vim a try.

best regards,

Brian
 
L

Luke Graham

One more, in support of my editor "fetisch"...

Ctrl-w _ maximises the current window
Ctrl-w = makes all the windows the same size

I know theres already a bunch of people with a bunch of great tips,
but these two shortcuts make a big difference to my vimming.

Btw, a good way to practice moving with "hjkl" is by playing nethack :D
 
L

Logan Capaldo

Btw, a good way to practice moving with "hjkl" is by playing nethack :D

I always thought a good way to practice playing nethack was to use Vi,
but to each their own ;)
 
A

Andrew Walrond

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 assume you are not on Windows? In which case, yes, it is broken. I have
reported it to one of the maintainers, Doug Kearns.

If you convert vim-ruby-install.rb to a unix type file with dos2unix, it seems
to work. I think the whatever interprets the #! line doesn't understand dos
type line endings.

Alternatively,
cp -r compiler ftplugin indent syntax /share/vim/vim63/

works fine (replace /share with your own location)

Andrew Walrond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top