Skip to content

Commit

Permalink
add kv file support!
Browse files Browse the repository at this point in the history
  • Loading branch information
tshirtman committed Jul 29, 2012
1 parent cc0307f commit d865e1a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ftplugin/kv.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set softtabstop=4
set textwidth=79
set shiftwidth=4
set expandtab
set tabstop=8
set list
set listchars=tab:__,trail:.
1 change: 1 addition & 0 deletions plugin/kv.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
au BufRead,BufNewFile *.kv set filetype=kv
38 changes: 38 additions & 0 deletions syntax/kv.vim
Original file line number Diff line number Diff line change
@@ -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 <args>
else
command -nargs=+ HiLink hi def link <args>
endif

HiLink kivyPreproc PreProc
HiLink kivyComment Comment
HiLink kivyRule Function
HiLink kivyIdent Statement
HiLink kivyAttribute Label
delcommand HiLink
endif

0 comments on commit d865e1a

Please sign in to comment.