Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator
On 4/3/07, Thomas [EMAIL PROTECTED] wrote: Maybe I misunderstand the problem but can't you change those lines with just blanks to empty lines? Sure I can remove the whitespace characters. But I'd rather simply not have to care about them (but this is filetype-dependent because for some filetypes this really could be what I want). I was just wondering if there maybe already is a (buffer local) option to do this. Regards, Thomas. This is something that might be easier and better anyway. Recently on the list someone posted this little gem: autocmd BufRead,BufWrite * if ! bin | silent! %s/\s\+$//ge | endif That will erase any trailing whitespace whenever you save the file. --fREW
Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator
autocmd BufRead,BufWrite * if ! bin | silent! %s/\s\+$//ge | endif Thanks. I think this is about what I was looking for. Regards, Thomas.
Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator
On Tue, Apr 03, 2007 at 02:00:59PM EDT, Thomas wrote: Hi, This is something that I found annoying quite a time now and I'm pretty sure there is a simple solution for this problem. Paragraphs are defined as: A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the 'paragraphs' option. I often end up with seemingly blank lines that contain whitespace characters. Is there a way to make vim handle these lines as paragraph boundaries too as ip does? One could remap the {} keys but AFAIK these maps would be ignored by norm! and noremap commands. Does somebody know a way to do this? I understand this could also be considered a finesse/feature, but I personally would like to have to choice to treat lines containing only whitespace characters as empty lines. Maybe I misunderstand the problem but can't you change those lines with just blanks to empty lines? If it's just spaces we're talking about .. not tabs or other unprintables .. maybe something such as: :%s/^ *$//g .. would do it. And map it to something convenient if you use it on a regular basis. Or do you need to hold on to those spaces for any reason? Thanks, cga
Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator
Maybe I misunderstand the problem but can't you change those lines with just blanks to empty lines? Sure I can remove the whitespace characters. But I'd rather simply not have to care about them (but this is filetype-dependent because for some filetypes this really could be what I want). I was just wondering if there maybe already is a (buffer local) option to do this. Regards, Thomas.