Thank you
On Oct 26, 11:37 am, Tony Mechelynck <[EMAIL PROTECTED]>
wrote:
> On 26/10/08 16:28, Daniel Choi wrote:
>
>
>
>
>
> > Thank you all for the help.
>
> > I'm using John Beckett's solution now. But I'm interested in learning
> > how to script Vim with Ruby, and I could use some help with this half-
> > complete solution.
>
> > I wrote the following Ruby Vim script:
>
> > function! Headline(char)
> > ruby<< EOF
> > header_length = $curbuf[ $curbuf.line_number - 1 ].length
> > $curbuf.append $curbuf.line_number - 1, VIM::evaluate("a:char") *
> > header_length
> > EOF
> > endfunction
>
> > :call Headline('-')
>
> > will underline the current line with dash characters.
>
> > My question is, what's the easiest way to map this function -- which
> > takes a parameter -- to a key or key sequence?
>
> > Many thanks.
>
> :map <F5> :call Headline('')<Left><Left>
>
> Best regards,
> Tony.
> --
> "BASIC is the Computer Science equivalent of `Scientific Creationism'."
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---