Hi,
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I look?
Thanks,
Maurício
Hi,
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I look?
Thanks,
Maurício
Hi,
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I look?
i’m using it, it works pretty well.
:h ruby
there you have examples etc.
also check your vim version has ruby support compiled in:
:echo has(‘ruby’)
should print 1.
On Tuesday 21 January 2003 14:22, Maurício wrote:
Thanks,
Maurício
–
“Droit devant soi, on ne peut pas aller bien loin”
(straight in front of oneself, you can’t get very far)
–Le petit prince, Antoine de Saint-Exupery
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I look?
I use ruby to script vim whenever I get the chance. I have two such
scripts posted at vim.sf.net. One will parse C/C++ header files (only
C++ is ‘supported’, but it works for most what I have seen in C) and
generate highlighting for your classes, structs and typedefs. The other
is pretty new and is under development, but you can play with it if you
want. It generates C++ code templates. Right now it only works for
creating a .cpp file from whatever exists in the corresponding .h file.
I plan to add to it, so that it will update one from the other. Since I
hate it when my header and cpp files get out of sync. Anyway here are
the links to those scripts.
The Highlighter:
http://vim.sourceforge.net/script.php?script_id=274
The template generator:
http://vim.sourceforge.net/script.php?script_id=493
I find that what I usually do is write a ruby script that runs from the
command line then, I make a vimscript function that calls that script.
I use ruby in vim for everything I can, wait, I use ruby for everything
I can. I find that ruby’s text processing is far simpler than is
vimscript’s. Not to mention, ruby is a lot more capable language than
vimscript.
–
Michael
GnuPG Fingerprint: 4C56 7C23 8BD9 8B39 C4D4 B8F3 42FB 3634 31B5 E963
I’m sure a few of us would like to know what you’ve accomplished with
it, Emmanuel. Any interesting functions you’ve written?
Gavin
On Wednesday, January 22, 2003, 12:37:18 AM, Emmanuel wrote:
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I look?
i’m using it, it works pretty well.
Hi,
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I
look?i’m using it, it works pretty well.
:h rubythere you have examples etc.
also check your vim version has ruby support compiled in:
:echo has(‘ruby’)
should print 1.
I can get simple things to work, like:
:ruby puts ‘Hello’
However, :h ruby doesn’t show things I suppose to be possible, like
asking for the current selected area in visual mode, setting the
selection area etc.
[…],
Maurício
:h ruby is all there is too it, I’m afraid. The module doesn’t
support everything natively. IIRC, it was a lot of work for the
author to support what there is now.
For anything that’s not supported directly, you’ll have to find a way
to get vim to do it for you, with the VIM.command(cmd) method.
Gavin
On Wednesday, January 22, 2003, 3:07:54 AM, Maurício wrote:
I can get simple things to work, like:
:ruby puts ‘Hello’
However, :h ruby doesn’t show things I suppose to be possible, like
asking for the current selected area in visual mode, setting the
selection area etc.
Hello,
Is anyone using the VIM module to write scripts inside vim? I can’t
find documentation about that module, does anyone know where could I
look?i’m using it, it works pretty well.
I’m sure a few of us would like to know what you’ve accomplished with
it, Emmanuel. Any interesting functions you’ve written?
firstable as of now i’m pretty lame in ruby, i’m just starting.
anyway, i wrote something to supposedly do code completion (like C-X C-P) for
strongly typed OO languages using ctags, it’s at
http://www.vim.org/script.php?script_id=501, but it’s not very good for now
(not usable yet, it’s just online if people want to help).
next version should be much more ambitious (using racc for a bit of lex/yacc
parsing), but i’m stumbling on some limits of ctags, and for now i stopped a
bit until i find the time to add the missing functionnality.
generally the combination ruby/vim is really enthousiasting :O)
Gavin
emmanuel
On Tuesday 21 January 2003 14:49, Gavin Sinclair wrote:
On Wednesday, January 22, 2003, 12:37:18 AM, Emmanuel wrote:
–
“Droit devant soi, on ne peut pas aller bien loin”
(straight in front of oneself, you can’t get very far)
–Le petit prince, Antoine de Saint-Exupery
exactly. or write vimL functions and call them from ruby with VIM::evaluate.
On Tuesday 21 January 2003 17:19, Gavin Sinclair wrote:
For anything that’s not supported directly, you’ll have to find a way
to get vim to do it for you, with the VIM.command(cmd) method.
–
“Droit devant soi, on ne peut pas aller bien loin”
(straight in front of oneself, you can’t get very far)
–Le petit prince, Antoine de Saint-Exupery