I would like to auto-indent text blocks that I have just
put. At a minimum, I would like to
retab the new block of text, since otherwise I sometimes end up with tabs in files that shouldn't have tabs when I copy them from files that do have tabs without noticing.
This is my current solution, but I'm certianly open to better ones:
nnoremap p pV`]= nnoremap P PV`]=
This makes use of the
] built-in mark, which is the "last character of the previously changed or yanked text" (from
I'd prefer not to remap primitive fundamental keys such as
p, and this won't work with other methods of pasting (e.g. the middle-click in X11). Also, I haven't used this for very long so I'm not sure yet if there are any behavioral oddities.