My preferred method is {<CR>}<esc>shift+o , as it surpasses {<CR><CR>}<esc>k shift+s few strokes. However, I got into a rut with him, and in the end I just used o or O to grab new, correctly indented lines from empty when I should use S.
That is, configure your binding structure and open the line above:
if (true) { }//cursor here, press shift-o
And you get the indentation that you expect.
An open-tag trick is no less keypresses than <up><end><cr> , but when reinstalling and shifting a transition, you can quickly drop it.
In addition, do not forget to specify your manual indentation reset and block the movement. If you are inside a distorted curly brace, just use ={ (or =i{ if you are on top of one of the curly braces). I use this when I have a good idea that should see the text as soon as possible, and I don't worry about any frippery formatting until I have a break.
Chad wellington
source share