autoindent is subset of smartindent in vim?

后端 未结 1 1512
暗喜
暗喜 2021-02-01 17:24

:help autoindent : Copy indent from current line when starting a new line (typing in Insert mode or when using the \"o\" or \"O\" command). ..

相关标签:
1条回答
  • 2021-02-01 17:44

    smartindent is an old script that was meant, when it was written, to be a "smart" complement to autoindent. Since then, most languages have either specific indentation functions or use cindent with specific options.

    Generally, smartindent shouldn't be used at all.

    The following lines are usually enough to deal with indentation:

    set autoindent
    filetype plugin indent on
    

    autoindent is not strictly necessary but it's good to have it when working with plaintext.

    0 讨论(0)
提交回复
热议问题