Brian Silverman | 70325d6 | 2015-09-20 17:00:43 -0400 | [diff] [blame] | 1 | #!/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 | # |
| 17 | echo >/dev/null <<_NOTES_EOF |
| 18 | From: Patrick Lacasse <patlac@borabora.crchul.ulaval.ca> |
| 19 | Subject: vim color for google-ctemplate howto |
| 20 | To: google-ctemplate@googlegroups.com |
| 21 | Date: Fri, 4 Aug 2006 11:38:39 -0400 |
| 22 | |
| 23 | Hi group, |
| 24 | |
| 25 | I'm now using google-ctemplate. My text editor is vim. Here is a little gift |
| 26 | for other people like me. |
| 27 | |
| 28 | Howto have google-ctemplate colored by vim : |
| 29 | |
| 30 | In your home directory, run 'sh $0'. |
| 31 | |
| 32 | Now restart vim. |
| 33 | |
| 34 | This will autodetects file with tpl extension and colors them. You can change |
| 35 | the color by changing the HiLink lines ( try changing String by |
| 36 | Identifier ) . |
| 37 | |
| 38 | I'm not sure exactly about what are the legal marker names. Feel free to |
| 39 | change the regexes. |
| 40 | |
| 41 | I only tryed this with vim 6.4 , I just cut and past the things about version |
| 42 | checking. |
| 43 | |
| 44 | For more information about syntax higlithning in vim, try |
| 45 | :help syntax |
| 46 | |
| 47 | Amusez-vous bien, |
| 48 | |
| 49 | Patrick Lacasse |
| 50 | patlac@borabora.crchul.ulaval.ca |
| 51 | _NOTES_EOF |
| 52 | |
| 53 | save_IFS="${IFS}" |
| 54 | IFS="${IFS}:" |
| 55 | gettext_dir=FAILED |
| 56 | locale_dir=FAILED |
| 57 | first_param="$1" |
| 58 | for dir in $PATH |
| 59 | do |
| 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 |
| 74 | done |
| 75 | IFS="$save_IFS" |
| 76 | if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED |
| 77 | then |
| 78 | echo=echo |
| 79 | else |
| 80 | TEXTDOMAINDIR=$locale_dir |
| 81 | export TEXTDOMAINDIR |
| 82 | TEXTDOMAIN=sharutils |
| 83 | export TEXTDOMAIN |
| 84 | echo="$gettext_dir/gettext -s" |
| 85 | fi |
| 86 | if 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"' |
| 88 | elif 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"' |
| 90 | elif 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"' |
| 92 | else |
| 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 |
| 98 | fi |
| 99 | rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch |
| 100 | # |
| 101 | if mkdir _sh09814; then |
| 102 | $echo 'x -' 'creating lock directory' |
| 103 | else |
| 104 | $echo 'failed to create lock directory' |
| 105 | exit 1 |
| 106 | fi |
| 107 | # ============= .vim/syntax/tpl.vim ============== |
| 108 | if test ! -d '.vim'; then |
| 109 | $echo 'x -' 'creating directory' '.vim' |
| 110 | mkdir '.vim' |
| 111 | fi |
| 112 | if test ! -d '.vim/syntax'; then |
| 113 | $echo 'x -' 'creating directory' '.vim/syntax' |
| 114 | mkdir '.vim/syntax' |
| 115 | fi |
| 116 | if test -f '.vim/syntax/tpl.vim' && test "$first_param" != -c; then |
| 117 | $echo 'x -' SKIPPING '.vim/syntax/tpl.vim' '(file already exists)' |
| 118 | else |
| 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. |
| 132 | X |
| 133 | " For version 5.x: Clear all syntax items |
| 134 | " For version 6.x: Quit when a syntax file was already loaded |
| 135 | if version < 600 |
| 136 | X syntax clear |
| 137 | elseif exists("b:current_syntax") |
| 138 | X finish |
| 139 | endif |
| 140 | X |
| 141 | syntax match tplMarkerError "{{}\?\([^}]\+}\?\)*}}" |
| 142 | syntax match tplSectionMarker "{{[#/][A-Za-z_]\+}}" |
| 143 | syntax match tplInclude "{{>[A-Za-z_]\+}}" |
| 144 | syntax match tplComment "{{![A-Za-z_]\+}}" |
| 145 | syntax match tplVariableMarker "{{[_A-Za-z]\+}}" |
| 146 | X |
| 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 |
| 150 | if version >= 508 || !exists("did_tpl_syn_inits") |
| 151 | X if version < 508 |
| 152 | X let did_tpl_syn_inits = 1 |
| 153 | X command -nargs=+ HiLink hi link <args> |
| 154 | X else |
| 155 | X command -nargs=+ HiLink hi def link <args> |
| 156 | X endif |
| 157 | X |
| 158 | X HiLink tplSectionMarker Repeat |
| 159 | X HiLink tplInclude Include |
| 160 | X HiLink tplComment Comment |
| 161 | X HiLink tplVariableMarker String |
| 162 | X HiLink tplMarkerError Error |
| 163 | X |
| 164 | X delcommand HiLink |
| 165 | endif |
| 166 | X |
| 167 | let b:current_syntax = "tpl" |
| 168 | SHAR_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' |
| 176 | 536faef79eff0597e642c5db04c1f79d .vim/syntax/tpl.vim |
| 177 | SHAR_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 |
| 183 | fi |
| 184 | # ============= .vim/ftdetect/tpl.vim ============== |
| 185 | if test ! -d '.vim/ftdetect'; then |
| 186 | $echo 'x -' 'creating directory' '.vim/ftdetect' |
| 187 | mkdir '.vim/ftdetect' |
| 188 | fi |
| 189 | if test -f '.vim/ftdetect/tpl.vim' && test "$first_param" != -c; then |
| 190 | $echo 'x -' SKIPPING '.vim/ftdetect/tpl.vim' '(file already exists)' |
| 191 | else |
| 192 | $echo 'x -' extracting '.vim/ftdetect/tpl.vim' '(text)' |
| 193 | sed 's/^X//' << 'SHAR_EOF' > '.vim/ftdetect/tpl.vim' && |
| 194 | au BufRead,BufNewFile *.tpl set filetype=tpl |
| 195 | SHAR_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' |
| 203 | 774fd4a092b77400ef6e74a7256ff8ef .vim/ftdetect/tpl.vim |
| 204 | SHAR_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 |
| 210 | fi |
| 211 | rm -fr _sh09814 |
| 212 | exit 0 |