Saturday, April 9, 2011

Re: Any non-programmer users of Vim here?

On 08 Apr 2011, Eric Weir wrote:
>
[snip]

> My preference, in my current state of ignorance, anyway, would be to never insert hard line breaks. I do have to share most of my writing with people who don't know anything but Word. So when ready for sharing I would import into another application for formatting. Apple's TextEdit is perfectly adequate most of the time.

When I have to import a Vim file into OOWriter (Libreoffice as it now
is) I use this command, kindly supplied by Tim Chase in an earlier
thread (thanks, Tim):

:g/\%^\|\n\@<=\s*\n/,/\n\n\|\%$/j

This converts each paragraph into a continuous line. It also removes the
spaces between the paragraphs. You want that if you are going to use
indented paragraphs in OOWriter, but if you want block paragraphs
(spaces between paragraphs, no indents) you need to run a further
command to reinsert the spaces:

:%s/$/\r


NB. The first line usually gives an error message : "E16 invalid range",
but I find I can ignore this without any ill-effects.

Anthony


--
Anthony Campbell - ac@acampbell.org.uk
Microsoft-free zone - Using Debian GNU/Linux
http://www.acampbell.org.uk - sample my ebooks at
http://www.smashwords.com/profile/view/acampbell

--
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: