Syntax highlighting in vim for .ttl files

Fed up with plain black on white text when editing in vim?  I was, but not now!

Did you know Turtle syntax is really a subset of a broader syntax called Notation3?  I didn’t, but I do now! (proof at http://www.w3.org/DesignIssues/diagrams/n3/venn ).

There’s an N3 syntax highlighter for vim at http://www.vim.org/scripts/script.php?script_id=944 .

Just download the v1.1 file and put it in ~/.vim/syntax (you might need to make that directory) and then add the following to ~/.vim/filetype.vim

" RDF Notation 3 Syntax
augroup filetypedetect
au BufNewFile,BufRead *.n3  setfiletype n3
au BufNewFile,BufRead *.ttl  setfiletype n3
augroup END

 

(yes, including that spurious looking quotation mark at the beginning).

TA-DA!

Comments are closed.