vim: INI file syntax
authorTomas Zeman <tzeman@volny.cz>
Thu, 05 May 2011 06:49:45 +0200
changeset 13 28f1b26621eb
parent 12 689760d614d3
child 14 1de92b1b5cf3
vim: INI file syntax
config/.vim/filetype.vim
config/.vim/syntax/ini.vim
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/.vim/filetype.vim	Thu May 05 06:49:45 2011 +0200
@@ -0,0 +1,5 @@
+" TXT files - default width
+au BufNewFile,BufRead *.txt set tw=78
+
+" INI file syntax
+au BufNewFile,BufRead *.ini,*/.hgrc,*/.hg/hgrc setf ini
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/.vim/syntax/ini.vim	Thu May 05 06:49:45 2011 +0200
@@ -0,0 +1,27 @@
+" Vim syntax file
+" Language:	Vim 7.2 script
+" Filenames:    *.ini, .hgrc, */.hg/hgrc
+" Maintainer:	Peter Hosey
+" Last Change:	Nov 11, 2008
+" Version:	7.2-02
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn match   iniSection skipwhite contains=iniRule "^\[.\+\]$"
+
+syn match   iniRule "^[^=:]\{-1,}="
+syn match   iniRule "^[^:=]\{-1,}:"
+
+syn match   iniComment skipwhite "^[#;].*"
+
+" Highlighting Settings
+" ====================
+
+hi def link iniSection Keyword
+hi def link iniRule Identifier
+hi def link iniComment Comment
+
+let b:current_syntax = "ini"