Which options are required for Vim editor configuration files

  question, vim

Although Vim is easy to operate, for a Chinese developer, the default configuration of Vim is often garbled.
The second problem is indenting, how to make different system platforms see the same format of code layout.
When participating in open source projects, there are many common code specifications that deserve to be set as defaults.

I usually set tab to 4 spaces, and then use unix standard form of < LF >. As for the random code problem, I use this code to solve it

if has("multi_byte")
    set encoding=utf-8
    " English messages only
    "language messages zh_CN.utf-8

    if has('win32')
        language english
        let &termencoding=&encoding

    set fencs=utf-8,gbk,chinese,latin1
    set formatoptions+=mM
    set nobomb " 不使用 Unicode 签名

    if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
        set ambiwidth=double
    echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"