Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: bin using xxd |
Bram Moolenaar | e271909 | 2015-01-10 15:09:25 +0100 | [diff] [blame] | 3 | " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz> |
| 4 | " Last Change: Oct 23, 2014 |
| 5 | " Version: 8 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6 | " Notes: use :help xxd to see how to invoke it |
Bram Moolenaar | e271909 | 2015-01-10 15:09:25 +0100 | [diff] [blame] | 7 | " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | " For version 5.x: Clear all syntax items |
| 10 | " For version 6.x: Quit when a syntax file was already loaded |
| 11 | if version < 600 |
| 12 | syntax clear |
| 13 | elseif exists("b:current_syntax") |
| 14 | finish |
| 15 | endif |
| 16 | |
| 17 | syn match xxdAddress "^[0-9a-f]\+:" contains=xxdSep |
| 18 | syn match xxdSep contained ":" |
| 19 | syn match xxdAscii " .\{,16\}\r\=$"hs=s+2 contains=xxdDot |
| 20 | syn match xxdDot contained "[.\r]" |
| 21 | |
| 22 | " Define the default highlighting. |
| 23 | " For version 5.7 and earlier: only when not done already |
| 24 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 25 | if version >= 508 || !exists("did_xxd_syntax_inits") |
| 26 | if version < 508 |
| 27 | let did_xxd_syntax_inits = 1 |
| 28 | command -nargs=+ HiLink hi link <args> |
| 29 | else |
| 30 | command -nargs=+ HiLink hi def link <args> |
| 31 | endif |
| 32 | |
| 33 | HiLink xxdAddress Constant |
| 34 | HiLink xxdSep Identifier |
| 35 | HiLink xxdAscii Statement |
| 36 | |
| 37 | delcommand HiLink |
| 38 | endif |
| 39 | |
| 40 | let b:current_syntax = "xxd" |
| 41 | |
| 42 | " vim: ts=4 |