ZyX wrote:

> > This is a puzzle.  Can you write this as a Vim script instead of a
> > one-liner shell command?
> It is already normal vimscript: equivalent to
>     vim -N -u NONE -S <(<<EOF
>     call setline(".", range(1000))
>     function! EV()
>         echom 0
>         normal! gv30j
>     endfunction
>     vnoremap e :call EV()<CR>
>     call feedkeys("V4je")
>     EOF)
> 
> > Can you map something else than \e (is that
> > taken literally or converted into an escape?).
> Taken literally. I can, it does not matter.
> 
> > Why would the function
> > be called five times, there is only one \e.
> :h v_:
> :h :call | /doesn't handle

Well, if you found that you can also find:

    When a range is given and the function doesn't handle it
    itself, the function is executed for each line in the range,
    with the cursor in the first column of that line.  The cursor
    is left at the last line (possibly moved by the last function
    call).

And:

    If [range] is excluded, ":{range}call" will call the function for
    each line in the range, with the cursor on the start of each line.

-- 
hundred-and-one symptoms of being an internet addict:
263. You have more e-mail addresses than shorts.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui