Monday, June 3, 2019

Re: long line to paragraph all indented

On 2019-06-03, George Dinwiddie wrote:
> Tim
>
> On 6/3/19 5:43 PM, Tim Johnson wrote:
> >version 7.4 on ubuntu
> >non-gui
> >
> >given a long line indented to some nominal number of spaces, how can
> >I format this line to preset paragraph width but with each line in
> >paragraph retaining the original indentation.
> >example:
> >
> > Pour the remaining sauce over the enchiladas. Cover with leftover cheese and bake for about 20 minutes or until cheese is bubbling.
> >
> > becomes:
> >
> > Pour the remaining sauce over the enchiladas. Cover with leftover cheese
> > and bake for about 20 minutes or until cheese is bubbling.
>
> I use the external program 'fmt' to do it, like this:
>
> :.,.!fmt
>
> Does that give you the results you want?

Perhaps I misunderstood. If you want to actually reformat the line,
not just change the way it's displayed, then the normal-mode command

gqq

should do it. You may have to set 'autoindent' as well. See

:help 10.7
:help gq

Regards,
Gary

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190603220058.GD27734%40phoenix.
For more options, visit https://groups.google.com/d/optout.

No comments: