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).
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
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.
works fine (replace /share with your own location)
Andrew Walrond
···
On Wednesday 27 April 2005 10:34, Brian Schröder wrote:
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
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?
···
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
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
···
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?
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
···
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
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
These lines in your ~/vimrc should do it:
set smarttab
set sw=4 " replace 4 with whatever you like
Stefan
···
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
: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
···
On Wednesday 27 April 2005 21: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:
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.
···
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
Brian Schröder <ruby.brian@gmail.com> [2005-04-28 07:08]:
> 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.
···
On 27/04/05, Tilman Sauerbeck <tilman@code-monkey.de> wrote:
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.
···
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.
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
···
On 28/04/05, Bagfields <bagfields@spymac.com> wrote:
Tilman Sauerbeck wrote:
> set sts=0 " forgot what this sucker did
softtabstop if non-zero, number of spaces to insert for a <Tab>
(local to buffer)
set sts=0
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
···
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.
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
···
On 4/29/05, Brian Schröder <ruby.brian@gmail.com> wrote:
On 28/04/05, Bagfields <bagfields@spymac.com> wrote:
>
> Tilman Sauerbeck wrote:
>
> > set sts=0 " forgot what this sucker did
>
> 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"