Forum: Ruby vim-ruby installation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2005-12-19 21:03
(Received via mailing list)
I've read though a bunch of the vim-ruby posts in this group, and
others, and still can't get my vim-ruby installation functioning
properly.  Here is what I've done:

1)   Installed the latest vim-ruby from RubyForge
Did an "ruby gem vim-ruby", ran the "vim-ruby-install.rb".
Now, I have the necessary ruby'esque files in my VIM installation
directory... ie:

/usr/share/vim/vim63/syntax
/usr/share/vim/vim63/ftplugin
/usr/share/vim/vim63/ftdetect
/usr/share/vim/vim63/compiler
/usr/share/vim/vim63/indent

I also confirmed that /usr/share/vim/vim63/filetype.vim has the proper
line that identifies ruby files by the given extensions (*.rb, *.gem,
*.ruby)


2)  I then created a .vimrc file in my home directory, and added the
following, as per the instructions on the vim-ruby page:

set nocompatible
syntax on
filetype on
filetype indent on
filetype plugin on


3)  Now, it doesn't work.
When I vim a ruby file, it does have the proper colors, but when I hit
"Tab", it inserts an actual Tab instead of 2 spaces, and things like
autocompleting "IF's" doesn't work by doing the Shift+Enter
combination.
So, the colors are correct... but nothing else !

Any help would be greatly appreciated !
Tim H. (Guest)
on 2005-12-19 22:44
(Received via mailing list)
removed_email_address@domain.invalid <removed_email_address@domain.invalid> 
wrote:
> /usr/share/vim/vim63/ftplugin
> added the following, as per the instructions on the vim-ruby
> page:
>
> set nocompatible
> syntax on
> filetype on
> filetype indent on
> filetype plugin on
>
>
> 3)  Now, it doesn't work.

> when I hit "Tab", it inserts an actual Tab instead of
> 2 spaces,

The vim-ruby set of vim configuration files do not change the
tabstop/softtabstop/shiftwidth/et al options.  As it says at
<http://www.rubygarden.org/ruby?VimRubySupport>, these are
inappropriate for a system-wide plugin, since they reflect user
preferences.

> and things like autocompleting "IF's" doesn't work
> by doing the Shift+Enter combination.

I attempted the "if"-statement completion at at the URL above.
If it still won't work for you, you might have better luck at
the vim-ruby ML at
<http://rubyforge.org/pipermail/vim-ruby-devel/>.

HTH,
Tim H.
Harpo (Guest)
on 2005-12-19 22:44
(Received via mailing list)
removed_email_address@domain.invalid wrote:

> When I vim a ruby file, it does have the proper colors,

It depends on what colors you like.

> but when I hit
> "Tab", it inserts an actual Tab instead of 2 spaces,

It seems to be a vim problem, but I don'have the vim NG in mind.
Well, I do not do this everyday, you have to set expandtab
:set expandtab
:set shiftwidth=2
I'm not sure of the syntax....
This should be in vim configuration files probably in a ftplugin
directory, this is very complicated but I think that the files
like .vimre .vim in your home directory are taken in account before the
others but I do not remember who overrides who.

But I'm sure it is something like that, in doubt hit the F1 key.
(Guest)
on 2005-12-20 00:09
(Received via mailing list)
Tim and Harpo... thank you !

I didn't realize that this vim-ruby package didn't take care of these
tihngs... even though I'd think that all Ruby users would want a 2
space indent... no ?

Also, thanks for pointing out that mailing list... didn't realize it
existed.  Thanks again !!
This topic is locked and can not be replied to.