Use nginx.vim tool for syntax highlighting and formatting configuration nginx.conf file

Use nginx.vim tool for syntax highlighting and formatting configuration nginx.conf file

I use tengine, the installation directory is /usr/local/tengine.

1. Download nginx.vim

https://www.vim.org/scripts/script.php?script_id=1886

2. Upload nginx.vim to ~/.vim/syntax/ and add the following content to the file ~/.vim/filetype.vim:

au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | ​​endif

(Flexible configuration according to Nginx installation directory)

If there is no directory or file, create one. My configuration is as follows:

au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/,/usr/local/tengine/conf/* if &ft == '' | setfiletype nginx | ​​endif

3. Then open nginx.conf, and it has color, haha.

It started like this:

Now it looks like this:

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Nginx server configuration HTTPS nginx.config configuration file (tutorial)
  • Detailed explanation of ThinkPHP's nginx.config configuration example on Alibaba Cloud
  • Detailed description of Nginx configuration file nginx.conf
  • Nginx configuration file (nginx.conf) configuration details (summary)
  • Detailed explanation of the nginx.conf configuration file in the Nginx server
  • Common configuration methods of Nginx configuration file nginx.conf
  • A relatively complete explanation of the common parameters of the Nginx configuration file nginx.conf in Chinese
  • Chinese comments on Nginx's nginx.conf configuration file
  • Chinese comments on the nginx configuration file nginx.conf
  • Summary of the nginx.conf configuration file structure

<<:  How to solve the problem of MySQL query character set mismatch

>>:  Full analysis of Vue diff algorithm

Recommend

Tutorial on how to connect and use MySQL 8.0 in IDEA's Maven project

First, let's take a look at my basic developm...

Syntax alias problem based on delete in mysql

Table of contents MySQL delete syntax alias probl...

Two ways to clear float in HTML

1. Clear floating method 1 Set the height of the ...

React antd tabs switching causes repeated refresh of subcomponents

describe: When the Tabs component switches back a...

You Probably Don’t Need to Use Switch Statements in JavaScript

Table of contents No switch, no complex code bloc...

Learn more about MySQL indexes

1. Indexing principle Indexes are used to quickly...

Axios secondary encapsulation example Demo in the project

1. Why do packaging? Facilitates overall code cal...

Linux file/directory permissions and ownership management

1. Overview of file permissions and ownership 1. ...

A brief discussion on CSS cascading mechanism

Why does CSS have a cascading mechanism? Because ...

How to dynamically modify the replication filter in mysql

MySQL dynamically modify replication filters Let ...

7 useful new TypeScript features

Table of contents 1. Optional Chaining 2. Null va...

How to install and configure the Docker Compose orchestration tool in Docker.v19

1. Introduction to Compose Compose is a tool for ...

Vue event's $event parameter = event value case

template <el-table :data="dataList"&...