Package: gtypist / 2.9.1-2.1

220581_gtypist_vim_support.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Description: Add gtypist support to VIM
 The file gtypist.vim has been missed to ship in release 2.9.1. Upstream
 has been informed. With the next release this patch should only contain
 the creation of tools/gtypist.yaml and tools/gtypist-filetype.vim.
Author: Daniel Leidert <daniel.leidert@wgdd.de>
Bug-Debian: http://bugs.debian.org/220581
Forwarded: no
Last-Update: 2011-11-29

--- /dev/null
+++ b/tools/gtypist.vim
@@ -0,0 +1,83 @@
+" Vim syntax file
+" Language: GNU Typist script
+" Maintainer: Felix Natter <fnatter@gmx.net> (bug-gtypist@gnu.org)
+" URL: http://www.gnu.org/software/gtypist/ (tools/gtypist.vim in the
+" source-package)
+" Filenames: *.typ
+" Last Change: (see ChangeLog below)
+
+" README:
+" Installation:
+" 'vimrc' is ~/.vimrc on UNIX, and $HOME/_vimrc on DOS/Windows.
+" This command should be at the top of your vimrc:
+"  autocmd!  " Remove ALL autocommands for the current group
+" (which avoids problems if vimrc is sourced more than once)
+" and this should be in there too:
+"  syntax on " turn on syntax highlighting
+"
+" vim 5.x:
+" copy this file to where the syntax-files go and use this BEFORE "syntax on":
+"  autocmd BufNewFile,BufRead *.typ set ft=gtypist
+" (this is also the recommended way to install with vim 6.x on DOS/Windows)
+"
+" vim 6.x:
+" create ~/.vim/syntax:
+" $ mkdir -p ~/.vim/syntax
+" and put this file in there:
+" $ mv gtypist.vim ~/.vim/syntax
+" put this BEFORE "syntax on" in vimrc:
+"  autocmd BufNewFile,BufRead *.typ setf gtypist
+
+" ChangeLog:
+" Sat Oct 20 14:35:44 CEST 2001: initial version
+" Sun Oct 21 02:48:24 CEST 2001: use "Error" for gtypistExitCmd
+
+" TODO:
+" - E: color number in Float
+
+" 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 case match
+
+syn keyword gtypistKeyword default Default NULL
+" this is necessary so that ':' is not colored
+syn match gtypistCmdSeparator ":" contained
+syn match gtypistCmd "^[A-Za-z ]:" contains=gtypistCmdSeparator
+syn match gtypistExitCmd "^X:" contains=gtypistCmdSeparator
+syn match gtypistSetLabelCmd "^\*:" contains=gtypistCmdSeparator
+syn keyword gtypistTODO TODO FIXME NOTE XXX contained
+syn match gtypistComment "^[#!].*" contains=gtypistTODO
+syn region gtypistDrillContent start="^[DdSs]:" skip="^ :" end="^" contains=gtypistCmd
+syn match gtypistLabel "^\*:.*" contains=gtypistSetLabelCmd
+syn match gtypistLabelRef "^[GYNF]:.*" contains=gtypistCmd
+syn match gtypistKeybind "^K:[0-9]\+:" contains=gtypistCmd,gtypistCmdSeparator
+syn match gtypistKeybindLabelRef "^K:[0-9]\+:.*" contains=gtypistKeybind
+syn match gtypistBanner "^B:.*" contains=gtypistCmd
+
+if !exists("did_gtypist_syntax_inits")
+  let did_gtypist_syntax_inits = 1
+  " note: the links are not very logical (i.e. gtypistLabel != Label),
+  " because i.e. Label,Keyword look the same (and aren't readable in the GUI)
+  " write to the maintainer if you know a way to make this more logical
+  highlight link gtypistKeyword Keyword
+  highlight link gtypistCmd SpecialChar
+  highlight link gtypistExitCmd Error
+  highlight link gtypistComment Comment
+  highlight link gtypistDrillContent String
+  highlight link gtypistTODO Todo
+" Delimiter looks the same as SpecialChar, so this is commented out
+"  highlight link gtypistCmdSeparator Delimiter
+  highlight link gtypistLabel Type
+  highlight link gtypistLabelRef Include
+  highlight link gtypistKeybindLabelRef gtypistLabelRef
+  highlight gtypistBanner term=bold cterm=bold gui=bold
+endif
+
+let b:current_syntax = "gtypist"
+
--- /dev/null
+++ b/tools/gtypist_filetype.vim
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.typ set filetype=gtypist
--- /dev/null
+++ b/tools/gtypist.yaml
@@ -0,0 +1,5 @@
+addon: gtypist
+description: allow syntax highlighting and autodetection for gtypist files
+files:
+  - syntax/gtypist.vim
+  - ftdetect/gtypist_filetype.vim