Friday, May 28, 2010

Re: blank lines

On 28/05/10 18:12, epanda wrote:
> Hi,
>
> I am trying to add some blank lines or carriage return to actionscript
> file in order to make reading clear.
>
> call append(line('^'),"\n")
>
> I see this character ^@ at the beginning of my file. I would like only
> to see newline.
>
> I think it is set file format that does not correspond to the good one
> but on't know why.*
>
>
> Thank you
>

RTFM, :help append(), paraphrased below:

The second parameter to append() can be either a String or a List.

If a String, it will become only one line, with no linebreaks in the
middle. Both 0x00 and 0x0A produce a null (stored internally as a linefeed).

If a List, each item in the List will become one line. So to append the
three following lines the third one of which is empty) before line 1 of
the file,

THIS IS ONE BIG UNDERLINED TITLE WITH AN EMPTY LINE BELOW IT
============================================================


use
:call append(0, [
\ 'THIS IS ONE BIG UNDERLINED TITLE WITH AN EMPTY LINE BELOW IT',
\ '============================================================',
\ '' ])

Of course, only Vim 7 supports Lists, so this example won't work in Vim
6.x or earlier.


Best regards,
Tony.
--
"I'm really enjoying not talking to you ... Let's not talk again _REAL_
soon ..."

--
You received this message from the "vim_use" 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

No comments:

Post a Comment