set nocompatible set number colors desert syntax on set ruler set showcmd set cursorline set fileencodings=utf-8,gbk set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set fileformats=unix set hlsearch set formatoptions-=cro set paste " set list " comment here
filetype
vi ~/.vim/filetype.vim, 在 vim 中可以通过 :set syntax? 查看当前 syntax 的值
1 2
autocmd BufRead,BufNewFile my.cnf set syntax=dosini autocmd BufRead,BufNewFile build.gradle set syntax=groovy
:update Save any changes. :e ++ff=dos Edit file again, using dos file format ('fileformats' is ignored). :setlocal ff=unix This buffer will use LF-only line endings when written. :w Write buffer using unix (LF-only) line endings.