首页 > 其他 > 详细

Nginx配置文件的高亮显示设置

时间:2019-02-05 11:09:39      阅读:211      评论:0      收藏:0      [点我收藏+]

linux系统下vim或者vi编辑器默认是没有对nginx的语法高亮设置。

 

1.下载vi语法高亮配置到 ~/.vim/syntax,如果不存在则创建该目录,cd ~/.vim/syntax

wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O nginx.vim

 

2.增加配置~/.vim/filetype.vim 到最后一行,如果文件不存在则创建,vi ~/.vim/filetype.vim

[root@chat-otc .vim]# cat filetype.vim 
au BufRead,BufNewFile /application/nginx-1.12.2/conf/* set ft=nginx

其中/application/nginx-1.12.2/conf/* 为你的nginx.conf文件路径,也可以写成/application/nginx-1.12.2/*

 

3. 整体目录

[root@hotcoin-chat-otc ~]# ll /root/.vim/
total 8
-rw-r--r-- 1 root root   68 Dec 17 18:12 filetype.vim
drwxr-xr-x 2 root root 4096 Feb  5 10:51 syntax
[root@hotcoin-chat-otc ~]# ll /root/.vim/syntax/
total 32
-rw-r--r-- 1 root root 29541 Dec 17 18:11 nginx.vim

Nginx配置文件的高亮显示设置

原文:https://www.cnblogs.com/ybyqjzl/p/10352565.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!