From 88f06ba54f21c97aa9f997aa40f502d8b7da541a Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Tue, 30 Mar 2010 21:44:55 +0800 Subject: Include vim syntax file for uzbl. --- extras/vim/ftdetect/uzbl.vim | 2 + extras/vim/syntax/uzbl.vim | 138 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 extras/vim/ftdetect/uzbl.vim create mode 100644 extras/vim/syntax/uzbl.vim (limited to 'extras') diff --git a/extras/vim/ftdetect/uzbl.vim b/extras/vim/ftdetect/uzbl.vim new file mode 100644 index 0000000..58214df --- /dev/null +++ b/extras/vim/ftdetect/uzbl.vim @@ -0,0 +1,2 @@ +au BufRead,BufNewFile .config/uzbl/* set filetype=uzbl +au BufRead,BufNewFile */uzbl/config set filetype=uzbl diff --git a/extras/vim/syntax/uzbl.vim b/extras/vim/syntax/uzbl.vim new file mode 100644 index 0000000..30b07c2 --- /dev/null +++ b/extras/vim/syntax/uzbl.vim @@ -0,0 +1,138 @@ +" Vim syntax file +" Language: Uzbl config syntax +" Maintainer: Mason Larobina +" Contributors: Gregor Uhlenheuer (kongo2002) +" Pawel Tomak (grodzik) +" Version: 0.1 +" +" Installing: +" To install this syntax file place it in your `~/.vim/syntax/` directory. +" +" To enable automatic uzbl-config file type detection create a new file +" `~/.vim/ftdetect/uzbl.vim` with the following lines inside: +" +" au BufRead,BufNewFile ~/.config/uzbl/* set filetype=uzbl +" au BufRead,BufNewFile */uzbl/config set filetype=uzbl +" +" Issues: +" 1. Hilighting inside @[]@, @()@, @<>@ and string regions would be nice. +" 2. Accidentally matches keywords inside strings. +" + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn keyword uzblKeyword back forward scroll reload reload_ign_cache stop +syn keyword uzblKeyword zoom_in zoom_out toggle_zoom_type uri script +syn keyword uzblKeyword toggle_status spawn sync_spawn sync_sh talk_to_socket +syn keyword uzblKeyword exit search search_reverse search_clear dehilight set +syn keyword uzblKeyword dump_config dump_config_as_events chain print event +syn keyword uzblKeyword request menu_add menu_link_add menu_image_add +syn keyword uzblKeyword menu_editable_add menu_separator menu_link_separator +syn keyword uzblKeyword menu_image_separator menu_editable_separator +syn keyword uzblKeyword menu_remove menu_link_remove menu_image_remove +syn keyword uzblKeyword menu_editable_remove hardcopy include + +syn match uzblKeyword /\.\@@ regions +syn region uzblJSExec display start=+@<+ end=+>@+ end=+$+ +syn region uzblEscape start=+\\@<+ end=+>\\@+ + +" Match quoted regions +syn region uzblString display start=+'+ end=+'+ end=+$+ contains=uzblExpand,uzblEscape,uzblHexCol,uzblArgs,uzblInternalExpand,uzblEnvironVariable,uzblXMLEscape,uzblShellExec,uzblJSExec +syn region uzblString display start=+"+ end=+"+ end=+$+ contains=uzblExpand,uzblEscape,uzblHexCol,uzblArgs,uzblInternalExpand,uzblEnvironVariable,uzblXMLEscape,uzblShellExec,uzblJSExec + +if version >= 508 || !exists("did_uzbl_syn_inits") + if version <= 508 + let did_uzbl_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink uzblComment Comment + HiLink uzblTodo Todo + + HiLink uzblSection Folded + HiLink uzblSubSection SpecialComment + + HiLink uzblKeyword Keyword + + HiLink uzblInt Number + HiLink uzblPercent Number + HiLink uzblFloat Float + + HiLink uzblHexCol Constant + + HiLink uzblArgs Identifier + + HiLink uzblExpand Type + HiLink uzblFunctExpand Macro + HiLink uzblEnvironVariable Number + HiLink uzblInternalExpand Identifier + + HiLink uzblXMLEscape Macro + HiLink uzblShellExec Macro + HiLink uzblJSExec Macro + + HiLink uzblEscape Special + + HiLink uzblString String + + delcommand HiLink +endif + +let b:current_syntax = 'uzbl' -- cgit v1.2.3