How to highlight NGINX configuration files in VIM

WBOY
Release: 2023-05-14 21:16:10
forward
1415 people have browsed it

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
Copy after login

Configure filetype.vim

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

vim /usr/share/vim/vim74/filetype.vim
Copy after login

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
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!