Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
vim-vdb | ||
======= | ||
vdb syntax | ||
========== | ||
|
||
Syntax highlighting for human-readable key:value databases | ||
JWC :: jwcxz.com | ||
|
||
|
||
This is a simple set of highlighting rules for files consisting of `key:value` | ||
pairs, plus some highlighting for indentation. | ||
|
||
Format looks like this: | ||
|
||
first level | ||
second level | ||
third level | ||
keytype1: value | ||
keytype2# value | ||
|
||
Note that two different symbols are defined: `:` and `#`. It's easy enough to | ||
add some more. I use this to define information that I care about and don't | ||
care about. This usually goes nicely with `fdm=indent`. | ||
|
||
|
||
![screenshot](https://raw.github.com/jwcxz/vim-vdb/master/vdb.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
" Vim syntax file | ||
" Language: VDB (simple text database) | ||
" Maintainer: Joe Colosimo (jwcxz.com) | ||
" Last Change: | ||
" Vim URL: http://www.vim.org/lang.html | ||
|
||
if version < 600 | ||
syntax clear | ||
elseif exists("b:current_syntax") | ||
finish | ||
endif | ||
|
||
setlocal iskeyword=a-z,A-Z,48-57,.,_ | ||
setlocal isident=a-z,A-Z,48-57,.,_ | ||
syn case ignore | ||
|
||
syn match vdbH1 "^\([^: ]\)\([^:]*\)$" | ||
syn match vdbH2 "^\(\s\{4\}\)\([^: ]\)\([^:]*\)$" | ||
syn match vdbH3 "^\(\s\{8,\}\)\([^: ]\)\([^:]*\)$" | ||
|
||
syn match vdbKey1 "^\([^:#]\+\):\s\?" nextgroup=vdbVal1 | ||
syn region vdbVal1 start="." end="$" contained | ||
|
||
syn match vdbKey2 "^\([^:#]\+\)#\s\?" nextgroup=vdbVal2 | ||
syn region vdbVal2 start="." end="$" contained | ||
|
||
|
||
hi def link vdbH1 Special | ||
hi def link vdbH2 PreProc | ||
hi def link vdbH3 Type | ||
|
||
hi def link vdbKey1 Function | ||
hi def link vdbVal1 String | ||
|
||
hi def link vdbKey2 Comment | ||
hi def link vdbVal2 Comment | ||
|
||
|
||
let b:current_syntax = "vdb" | ||
" vim: ts=4 sw=4 : | ||
|