[ Home ]

PostgreSQL Vim Syntax File

Looking for PostgreSQL syntax highlighting in Vim?

I originally copied the Vim distribution's supplied sql.vim to postgresql.vim and edited that. But, then I found Devrim Gunduz'spgsql.vim, edited that to my liking, and e-mailed him my changes. Download my edited version.

If you use Fedora, postgresql.vim will go in /usr/share/vim/vim71/syntax, and you will also want to add, to the appropriate place in /usr/share/vim/vim71/filetype.vim, the following lines:

" PostgreSQL
au BufNewFile,BufRead *.pgsql         setf pgsql

(I put mine right after the Postfix entry, respecting the alphabetical order of the entries.)

Vim RC Files

These are the files I use for vi and vim. I've renamed them without the leading dot and with a .txt extension just so they'll be associated with a text/plain MIME type if you decide to download them.