Skip to content

Instantly share code, notes, and snippets.

@daiooo
Forked from ralavay/vim-nginx-conf-highlight.sh
Last active November 19, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daiooo/3505e39ca5ca03a5932fc4b0787a6b4c to your computer and use it in GitHub Desktop.
Save daiooo/3505e39ca5ca03a5932fc4b0787a6b4c to your computer and use it in GitHub Desktop.
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget -O ~/.vim/syntax/nginx.vim http://www.vim.org/scripts/download_script.php?src_id=19394
# Set location of Nginx config file
cat >> ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile */nginx/servers/*,*/nginx/ssl/*,*/nginx/config/*,*/nginx.conf if &ft == '' | setfiletype nginx | endif
EOF
#May want to use cat >> ~/.vim/filetype.vim <<EOF if you have a pre-existing filetype.vim file--the single > output redirection will overwrite the file, double >> will append to it.
@daiooo
Copy link
Author

daiooo commented Apr 4, 2019

sh -c "$(wget -O- https://git.io/JeKKi)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment