blob: 67d534dcaf037dd72c7da5ee93c419fa08ce0ad2 [file] [log] [blame]
Brian Silverman70325d62015-09-20 17:00:43 -04001#!/bin/sh
2# This is a shell archive (produced by GNU sharutils 4.2.1).
3# To extract the files from this archive, save it to some FILE, remove
4# everything before the `!/bin/sh' line above, then type `sh FILE'.
5#
6# Made on 2006-08-08 13:38 PDT by <patlac@borabora.crchul.ulaval.ca>.
7# Commandline: shar -T .vim
8#
9# Existing files will *not* be overwritten unless `-c' is specified.
10#
11# This shar contains:
12# length mode name
13# ------ ---------- ------------------------------------------
14# 1477 -rw-r--r-- .vim/syntax/tpl.vim
15# 56 -rw-r--r-- .vim/ftdetect/tpl.vim
16#
17echo >/dev/null <<_NOTES_EOF
18From: Patrick Lacasse <patlac@borabora.crchul.ulaval.ca>
19Subject: vim color for google-ctemplate howto
20To: google-ctemplate@googlegroups.com
21Date: Fri, 4 Aug 2006 11:38:39 -0400
22
23Hi group,
24
25 I'm now using google-ctemplate. My text editor is vim. Here is a little gift
26for other people like me.
27
28Howto have google-ctemplate colored by vim :
29
30In your home directory, run 'sh $0'.
31
32Now restart vim.
33
34This will autodetects file with tpl extension and colors them. You can change
35the color by changing the HiLink lines ( try changing String by
36Identifier ) .
37
38I'm not sure exactly about what are the legal marker names. Feel free to
39change the regexes.
40
41I only tryed this with vim 6.4 , I just cut and past the things about version
42checking.
43
44For more information about syntax higlithning in vim, try
45:help syntax
46
47Amusez-vous bien,
48
49Patrick Lacasse
50patlac@borabora.crchul.ulaval.ca
51_NOTES_EOF
52
53save_IFS="${IFS}"
54IFS="${IFS}:"
55gettext_dir=FAILED
56locale_dir=FAILED
57first_param="$1"
58for dir in $PATH
59do
60 if test "$gettext_dir" = FAILED && test -f $dir/gettext \
61 && ($dir/gettext --version >/dev/null 2>&1)
62 then
63 set `$dir/gettext --version 2>&1`
64 if test "$3" = GNU
65 then
66 gettext_dir=$dir
67 fi
68 fi
69 if test "$locale_dir" = FAILED && test -f $dir/shar \
70 && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
71 then
72 locale_dir=`$dir/shar --print-text-domain-dir`
73 fi
74done
75IFS="$save_IFS"
76if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
77then
78 echo=echo
79else
80 TEXTDOMAINDIR=$locale_dir
81 export TEXTDOMAINDIR
82 TEXTDOMAIN=sharutils
83 export TEXTDOMAIN
84 echo="$gettext_dir/gettext -s"
85fi
86if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
87 shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
88elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
89 shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
90elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
91 shar_touch='touch -am $3$4$5$6$2 "$8"'
92else
93 shar_touch=:
94 echo
95 $echo 'WARNING: not restoring timestamps. Consider getting and'
96 $echo "installing GNU \`touch', distributed in GNU File Utilities..."
97 echo
98fi
99rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
100#
101if mkdir _sh09814; then
102 $echo 'x -' 'creating lock directory'
103else
104 $echo 'failed to create lock directory'
105 exit 1
106fi
107# ============= .vim/syntax/tpl.vim ==============
108if test ! -d '.vim'; then
109 $echo 'x -' 'creating directory' '.vim'
110 mkdir '.vim'
111fi
112if test ! -d '.vim/syntax'; then
113 $echo 'x -' 'creating directory' '.vim/syntax'
114 mkdir '.vim/syntax'
115fi
116if test -f '.vim/syntax/tpl.vim' && test "$first_param" != -c; then
117 $echo 'x -' SKIPPING '.vim/syntax/tpl.vim' '(file already exists)'
118else
119 $echo 'x -' extracting '.vim/syntax/tpl.vim' '(text)'
120 sed 's/^X//' << 'SHAR_EOF' > '.vim/syntax/tpl.vim' &&
121" Vim syntax file
122" Language: google-ctemplate
123" Maintainer: Patrick Lacasse <patlac@borabora.crchul.ulaval.ca>
124" Last Change: 2006 Aoรปt 03
125"
126" For information about google-ctemplate see
127" http://goog-ctemplate.sourceforge.net/
128"
129" This vim syntax file works on vim 5.6, 5.7, 5.8 and 6.x.
130" It implements Bram Moolenaar's April 25, 2001 recommendations to make
131" the syntax file maximally portable across different versions of vim.
132X
133" For version 5.x: Clear all syntax items
134" For version 6.x: Quit when a syntax file was already loaded
135if version < 600
136X syntax clear
137elseif exists("b:current_syntax")
138X finish
139endif
140X
141syntax match tplMarkerError "{{}\?\([^}]\+}\?\)*}}"
142syntax match tplSectionMarker "{{[#/][A-Za-z_]\+}}"
143syntax match tplInclude "{{>[A-Za-z_]\+}}"
144syntax match tplComment "{{![A-Za-z_]\+}}"
145syntax match tplVariableMarker "{{[_A-Za-z]\+}}"
146X
147" Define the default highlighting.
148" For version 5.7 and earlier: only when not done already
149" For version 5.8 and later: only when an item doesn't have highlighting yet
150if version >= 508 || !exists("did_tpl_syn_inits")
151X if version < 508
152X let did_tpl_syn_inits = 1
153X command -nargs=+ HiLink hi link <args>
154X else
155X command -nargs=+ HiLink hi def link <args>
156X endif
157X
158X HiLink tplSectionMarker Repeat
159X HiLink tplInclude Include
160X HiLink tplComment Comment
161X HiLink tplVariableMarker String
162X HiLink tplMarkerError Error
163X
164X delcommand HiLink
165endif
166X
167let b:current_syntax = "tpl"
168SHAR_EOF
169 (set 20 06 08 08 13 34 11 '.vim/syntax/tpl.vim'; eval "$shar_touch") &&
170 chmod 0644 '.vim/syntax/tpl.vim' ||
171 $echo 'restore of' '.vim/syntax/tpl.vim' 'failed'
172 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
173 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
174 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
175 || $echo '.vim/syntax/tpl.vim:' 'MD5 check failed'
176536faef79eff0597e642c5db04c1f79d .vim/syntax/tpl.vim
177SHAR_EOF
178 else
179 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '.vim/syntax/tpl.vim'`"
180 test 1477 -eq "$shar_count" ||
181 $echo '.vim/syntax/tpl.vim:' 'original size' '1477,' 'current size' "$shar_count!"
182 fi
183fi
184# ============= .vim/ftdetect/tpl.vim ==============
185if test ! -d '.vim/ftdetect'; then
186 $echo 'x -' 'creating directory' '.vim/ftdetect'
187 mkdir '.vim/ftdetect'
188fi
189if test -f '.vim/ftdetect/tpl.vim' && test "$first_param" != -c; then
190 $echo 'x -' SKIPPING '.vim/ftdetect/tpl.vim' '(file already exists)'
191else
192 $echo 'x -' extracting '.vim/ftdetect/tpl.vim' '(text)'
193 sed 's/^X//' << 'SHAR_EOF' > '.vim/ftdetect/tpl.vim' &&
194au BufRead,BufNewFile *.tpl set filetype=tpl
195SHAR_EOF
196 (set 20 06 08 08 13 34 20 '.vim/ftdetect/tpl.vim'; eval "$shar_touch") &&
197 chmod 0644 '.vim/ftdetect/tpl.vim' ||
198 $echo 'restore of' '.vim/ftdetect/tpl.vim' 'failed'
199 if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
200 && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
201 md5sum -c << SHAR_EOF >/dev/null 2>&1 \
202 || $echo '.vim/ftdetect/tpl.vim:' 'MD5 check failed'
203774fd4a092b77400ef6e74a7256ff8ef .vim/ftdetect/tpl.vim
204SHAR_EOF
205 else
206 shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '.vim/ftdetect/tpl.vim'`"
207 test 56 -eq "$shar_count" ||
208 $echo '.vim/ftdetect/tpl.vim:' 'original size' '56,' 'current size' "$shar_count!"
209 fi
210fi
211rm -fr _sh09814
212exit 0