In the production environment, we must often use the Nginx.conf file layout work, today in reading "The decisive Nginx" when inadvertently see nginx.vim this auxiliary tool, so Baidu search and actual deployment of testing, the effect really let people refreshing, It may be clear that grammatical errors are found. So let's talk about how it's deployed.
First Look at:
How is it still cool, here is the deployment method:
1. Download Nginx.vim
http://www.vim.org/scripts/script.php?script_id=1886 used here is the 0.3.3 version
2. Copy the downloaded file to the/usr/share/vim/vim72/syntax/directory, and also get the user's directory under ~/.vim/syntax/. However, it is recommended that you deploy to a system level so that users can use them.
3. Configure Nginx.vim
Vim/usr/share/vim/vim72/filetypr.vim #在文件中添加下面的一句话
Au bufread,bufnewfile/usr/local/nginx/conf/* set Ft=nginx
Among them,/usr/local/nginx/conf/* for my nginx configuration file placement path, everyone according to their own situation to modify; Set Ft=nginx settings in effect is Nginx configuration file.
Now it's time to test. is vim nginx.conf also possible to achieve the effect?
Use the Nginx.vim tool for syntax highlighting and formatting configuration nginx.conf files