From d865e1a0899d00ae127eedecaa8693b22fb9e0b3 Mon Sep 17 00:00:00 2001 From: "gabriel.pettier" Date: Sun, 29 Jul 2012 22:54:07 +0200 Subject: [PATCH] add kv file support! --- ftplugin/kv.vim | 7 +++++++ plugin/kv.vim | 1 + syntax/kv.vim | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 ftplugin/kv.vim create mode 100644 plugin/kv.vim create mode 100644 syntax/kv.vim diff --git a/ftplugin/kv.vim b/ftplugin/kv.vim new file mode 100644 index 0000000..55ac03d --- /dev/null +++ b/ftplugin/kv.vim @@ -0,0 +1,7 @@ +set softtabstop=4 +set textwidth=79 +set shiftwidth=4 +set expandtab +set tabstop=8 +set list +set listchars=tab:__,trail:. diff --git a/plugin/kv.vim b/plugin/kv.vim new file mode 100644 index 0000000..b6899f7 --- /dev/null +++ b/plugin/kv.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.kv set filetype=kv diff --git a/syntax/kv.vim b/syntax/kv.vim new file mode 100644 index 0000000..79aa47d --- /dev/null +++ b/syntax/kv.vim @@ -0,0 +1,38 @@ +" Vim syntax file +" Language: Kivy +" Maintainer: George Sebastian <11george.s@gmail.com> +" Last Change: 2011 May 1 + +" For version 5.x: Clear all syntax items. +" For version 6.x: Quit when a syntax file was already loaded. +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn match kivyPreProc /#:.*/ +syn match kivyComment /#.*/ +syn match kivyRule /<\I\i*\(,\s*\I\i*\)*>:/ +syn match kivyAttribute /\<\I\i*\>/ nextgroup=kivyValue + +syn include @pyth $VIMRUNTIME/syntax/python.vim +syn region kivyValue start=":" end=/$/ contains=@pyth skipwhite + +syn region kivyAttribute matchgroup=kivyIdent start=/[\a_][\a\d_]*:/ end=/$/ contains=@pyth skipwhite + +if version >= 508 || !exists("did_python_syn_inits") + if version <= 508 + let did_python_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink kivyPreproc PreProc + HiLink kivyComment Comment + HiLink kivyRule Function + HiLink kivyIdent Statement + HiLink kivyAttribute Label + delcommand HiLink +endif