Created
March 3, 2013 01:03
-
-
Save 2called-chaos/5073996 to your computer and use it in GitHub Desktop.
enable nginx vim syntax highlighting (on Ubuntu/Debian)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p ~/.vim/syntax/ | |
cd ~/.vim/syntax/ | |
wget http://www.vim.org/scripts/download_script.php?src_id=19394 | |
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 | |
EOF |
You can use -O nginx.vim
with your wget
command and not need the mv
line.
Or just use the one provided by NGINX (see README).
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)
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
Nice one, thanks... I edited it before run. Just to add openresty default config dir " /usr/local/openresty/nginx/conf/* ". Worked pretty well!