On Fri, 04 Aug 2006 10:02:55 -0500
Tim Chase <[EMAIL PROTECTED]> wrote:


> Well, you mention not wanting to manually yank the 
> text...however, if it was automatically yanked into a register 
> for you, would that be okay?  Or do you not want to touch the 
> unnamed register at all?  If the former is okay, something like
> 
>       :vnoremap <f4> c<c-r>=Template(@")<cr><esc>
> 
> might do the trick for you.

It seems to almost work. I would actually like to yank the text and not
change it, but the real problem is if I do as above and define the
Template as below only to test that it works I alsways get an extra 0.

        function! Template(text)
                execute "normal! o>" . a:text . "<"
        endfunction

I mean if I mark the word: 
        
        house
        
Then I get: 

        >house0<

I happend to change the Template when I was trying to debug this and if
it is like this:

        function! Template(text)
                execute "normal! o>" . a:text . "<"
                execute "normal! o....."
        endfunction

Then marking house gives me:

        >house<
        ....0.

What is this 0?

The same happens if I do:

        :vnoremap <f4> "yyi<c-r>=Template(@y)<cr><esc>

Preben

Reply via email to