Home  >  Article  >  Operation and Maintenance  >  How to highlight NGINX configuration files in VIM

How to highlight NGINX configuration files in VIM

WBOY
WBOYforward
2023-05-14 21:16:101431browse

Download nginx.vim

Here we take the Linux system as an example, other systems are similar.

Switch to the vim syntax configuration directory and download the nginx syntax file.

It should be noted that vim74 in the path needs to correspond to the vim version number installed on the machine.

cd /usr/share/vim/vim74/syntax && wget -o nginx.vim https://vim.sourceforge.io/scripts/download_script.php?src_id=19394

Configure filetype.vim

Edit the filetype.vim file to register the nginx syntax file

vim /usr/share/vim/vim74/filetype.vim

Add the following code to the file, Among them, nginx_path needs to be replaced with the nginx configuration file directory on the machine, such as /etc/nginx/*:

" nginx
au bufnewfile,bufread nginx_path setf nginx

Effect overview

Before configuration


How to highlight NGINX configuration files in VIM

After configuration

How to highlight NGINX configuration files in VIM

The above is the detailed content of How to highlight NGINX configuration files in VIM. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete