Thursday, July 1, 2010

Re: format a paragraph with gq

On 07/01/2010 02:34 PM, linjus wrote:
> I often use "gq" command to format a paragraph. (As I mostly use that
> command in "Visual mode", technically, I format a selected text, but I
> always highlight only one paragraph.)
>
> It seems VIM sometimes puts two spaces between two words when it has
> to merge lines in a paragraph. For example, when tw=93 and the
> following text is highlighted, "gq" puts two spaces right after the
> period.
>
> sdfs lsdkf lsdkf lsdkf lskdf lsdkf ldskf lsdkf
> sdf.
> flsdf
>
> I'm not sure if this is because VIM recognizes periods and tries to do
> some smart things, but I really do not want this. I think it's not
> very consistent either; if the highlighted text were the following,
> there would be only one period after the period.
>
> sdfs lsdkf lsdkf lsdkf lskdf lsdkf ldskf. lsdkf flsdf
> sdf sdf sdf sdf sdf sdf sdf
>
> I don't know if my guess is correct, but the above example reproduces
> the problem. How can I enforce VIM to put only one space even though a
> line ends with a period?
>
> Just in case you may wonder my configuration, I'm using GVIM under
> Windows 7 and my "formatoptions" is "tcq".
>
> Thank you!
>


:set nojoinspaces

:help 'joinspaces

   -ak

--
 Python plugins for vim: outliner, todo list, project manager, calendar,
 expenses tracker, sortable table, and more |
 http://lightbird.net/pysuite/



No comments:

Post a Comment