Create a folder for your VIM syntax files.

>mkdir -p ~/.vim/syntax/

Download the syntax highlighting plugin.

>curl http://www.vim.org/scripts/download_script.php?src_id=14376 -o ~/.vim/syntax/nginx.vim

Add it to VIM’s file type definitions. Make sure to adjust the path to your Nginx installation if you need to.

>echo "au BufRead,BufNewFile /etc/nginx/conf/* set ft=nginx" >> ~/.vim/filetype.vim

Now enable syntax highlighting in your .vimrc file.

>echo "syntax enable" >> ~/.vimrc

That’s it. Now you’ll have nice colors when you edit your Nginx configs with VIM!

>vim /etc/nginx/conf/nginx.conf

NGINX配置文件高亮显示

相关文章:

  • 2021-10-12
  • 2021-07-05
  • 2021-04-08
  • 2021-09-20
  • 2022-01-15
  • 2021-04-22
  • 2021-06-28
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-06-13
  • 2021-07-15
相关资源
相似解决方案