I don’t know how to use that option, am I supposed to map it to a key combination?
<C-R><C-P>+ syntax means you press the keys “Ctrl-R” followed by “Ctrl-P” followed by “+” while in insert mode. You can map it to another key if you wish but it’s not necessary.
I was looking for a solution that works in normal mode too.
= key will re-indent a range in normal mode. E.g. using
=10j will re-indent the next 10 lines (see
:h = for more). The
'] mark is placed at the last line of yanked or changed text. We can combine these two by using
='] (that is, press
=, followed by
', followed by
']). This will re-indent all lines from the current cursor position to the end of the last changed block (likewise,
'[ will move you to the beginning of the last changed block).
That’s probably as good as you’ll get for a built-in solution. As for
bracketed-paste, if you read the help text for
:h 'paste' you’ll see the following
When the 'paste' option is switched on (also when it was already on):
- mapping in Insert mode and Command-line mode is disabled
- abbreviations are disabled
- 'autoindent' is reset
- 'expandtab' is reset
- 'hkmap' is reset
- 'revins' is reset
- 'ruler' is reset
- 'showmatch' is reset
- 'smarttab' is reset
- 'softtabstop' is set to 0
- 'textwidth' is set to 0
- 'wrapmargin' is set to 0
- 'varsofttabstop' is made empty
These options keep their value, but their effect is disabled:
- 'formatoptions' is used like it is empty
This is why your
cindent settings are not working.