Vim: Smart indent when entering insert mode on blank line?

后端 未结 3 1605
遥遥无期
遥遥无期 2020-12-23 13:35

When I open a new line (via \'o\') my cursor jumps to a correctly indented position on the next line. On the other hand, entering insert mode while my cursor is on a blank l

3条回答
  •  渐次进展
    2020-12-23 14:24

    On an empty line, to enter insert mode correctly indented, you can simply use s.

    Note that s is a synonym for cl, so if you're not actually on an empty line, it'll end up deleting a single character and not indenting. In that case, you're better off using cc, as sml suggested some 18 months ago. But I've frequently improved my score at VimGolf by using this shortcut, so thought I'd mention it. ;)

提交回复
热议问题