Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
enable nginx vim syntax highlighting (on Ubuntu/Debian)
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
mv download_script.php\?src_id\=19394 nginx.vim
cat > ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
Copy link

eddy85br commented Sep 27, 2015

Nice one, thanks... I edited it before run. Just to add openresty default config dir " /usr/local/openresty/nginx/conf/* ". Worked pretty well!

Copy link

ghost commented Mar 2, 2016

You can use -O nginx.vim with your wget command and not need the mv line.

Copy link

FranklinYu commented Mar 7, 2017

Or just use the one provided by NGINX (see README).

Copy link

tobia commented Jul 13, 2017

Yes, if you have an Nginx source tree laying around somewhere, it's just a matter of copying the Vim files over:

rsync -r /src/nginx/contrib/vim/ ~/.vim/

(don't omit the trailing slashes)

Copy link

kdidenko commented Jul 19, 2017

Doesn't matter when it works and simple! Great job! Thank you!

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