On 6/1/06, Benji Fisher <[EMAIL PROTECTED]> wrote:
...
> let line=getline(".")
> while (strlen(line)!=0)
> "do sth. here -- construct the external command and so on
> j
> let line=getline(".")
> endwhile
Remember that a vim script (including a plugin) is a list of
commands in Command-Line (Ex) mode, not Normal mode. So that j means
:j[oin], not "move the cursor down one line." If you change "j" to "+"
it will be a step in the right direction.
D'oh. For some reason I though 'j' was a variable and jumped to a
wishful[wrong] conclusion that it was really:
exe j
which would set the line number to an incrementing index. This is
useful if you are going to use :ex commands in addition to
function calls.
let linenr = 0
while linenr < line("$")
let linenr += 1 " The += construction requires vim 7.0 .
let line = getline(linenr)
" ...
exe linenr
endwhile