最近裝的兩台CentOS在vim nginx時,語法都沒有顏色,看的很辛苦
爬了下文,參照這兩個連結,得到解決
https://gist.github.com/ralavay/c4c7750795ccfd72c2db
https://www.centos.bz/2017/07/vim-nginx-conf-syntax-highlight/

$ sudo wget http://www.vim.org/scripts/download_script.php?src_id=14376 -O nginx.vim
$ sudo cp nginx.vim /usr/share/vim/vim74/syntax/
$ sudo vim /usr/share/vim/vim74/filetype.vim
將下面這段加到filetype.vim最下面
au BufRead,BufNewFile /etc/nginx/*,/etc/nginx/conf.d/*,/usr/local/etc/nginx/* if &ft == '' | setfiletype nginx | endif

完成,有色彩了