Monday, June 17, 2013

Re: Indentation issue

On Monday, June 17, 2013 10:24:36 AM UTC-5, Steve wrote:
> Hi,
>
>
>
> While writing a mail in French, I would like that each first line of a
>
> paragraph is indented, like this:
>
>
>
> ksjdk ksjdkjsddsj kjsdksjd kjsdksdj
>
> kjhkasjhd kajshdkajsdk, kajshd kjahsd
>
> akshd kajsh kahsd hdkask.
>
>
>
> kjsdkf ksjdhfsdf kjdshf klsdjhksd
>
> khsdj ksdjf ksdjhf ksdjh ksdhf, lslsl,
>
> lslsosk sljs ls lllss llksd llksddlskd
>
> lsdklsd.
>
>
>
> I would like it to be automatic. For the time being, if I manually indent with
>
> two spaces, next lines will be automatically indented by two spaces, I guess
>
> it's the 'set autoindent' setting that does that, which is ok for writing code
>
> but not emails (at least in French).
>

set fo+=2

and maybe

set fo+=a

You must still manually add two spaces indent to the first line, but after that the rest of the paragraph aligns as you want.

You could probably make some mappings to automatically enter the two spaces. Maybe:

inoremap <CR><CR> <CR><CR><Space><Space>

or

inoremap <CR><CR> <CR><CR><C-T>

And similar for pressing 'o' in normal mode. Consider buffer-local mappings so it only happens for plaintext files.

--
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment