NGINX 配置文件语法高亮
作者:
胸口砕大石 | 来源:发表于
2021-08-20 10:16 被阅读0次
安装VIM,下载插件
插件传送门
创建目录,并拷贝文件nginx.vim到目录下
mkdir -p ~/.vim/syntax/
[root@dispatch syntax]# pwd
/root/.vim/syntax
[root@dispatch syntax]# ll
总用量 32
-rw-r--r-- 1 root root 29542 8月 20 09:58 nginx.vim
[root@dispatch syntax]#
编辑/usr/share/vim/vim74/filetype.vim,加入下面代码
"nginx配置文件美化
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
格式化配置文件
#vim格式化命令
gg=G
齐活

真相
本文标题:NGINX 配置文件语法高亮
本文链接:https://www.haomeiwen.com/subject/vxzzbltx.html
网友评论