File: phtml.vim

package info (click to toggle)
vim-rt 5.3-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,172 kB
  • ctags: 815
  • sloc: makefile: 857; awk: 778; ansic: 379; perl: 192; sh: 167
file content (193 lines) | stat: -rw-r--r-- 11,572 bytes parent folder | 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
" Vim syntax file
" Language:	phtml PHP 2.0
" Maintainer:	Lutz Eymers <ixtab@polzin.com>
" URL:		http://www-public.rz.uni-duesseldorf.de/~eymers/stuff/syntax_vim.tgz
" Email:        Subject: send syntax_vim.tgz
" Last change:	1998 May 8

" Remove any old syntax stuff hanging around
syn clear

so $VIM/syntax/html.vim
syn clear htmlTag
syn clear javaScript
syn region  htmlTag                start=+<[^/]+ end=+>+              contains=htmlString,htmlTagName,htmlArg,htmlValue,htmlTagError,htmlEvent,phtmlRegion 
syn region  javaScript                           start=+<script+ end=+</script>+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaScriptStringD,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen,javaScriptParenError,phtmlRegion

syn case match

" Env Variables
syn keyword phtmlEnvVar SERVER_SOFTWARE SERVER_NAME SERVER_URL GATEWAY_INTERFACE   contained
syn keyword phtmlEnvVar SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD PATH_INFO  contained
syn keyword phtmlEnvVar PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST contained
syn keyword phtmlEnvVar REMOTE_ADDR AUTH_TYPE REMOTE_USER CONTEN_TYPE  contained
syn keyword phtmlEnvVar CONTENT_LENGTH HTTPS HTTPS_KEYSIZE HTTPS_SECRETKEYSIZE  contained
syn keyword phtmlEnvVar HTTP_ACCECT HTTP_USER_AGENT HTTP_IF_MODIFIED_SINCE  contained
syn keyword phtmlEnvVar HTTP_FROM  contained

syn case ignore

" Internal Variables
syn keyword phtmlIntVar phperrmsg php_self contained

" Comment
syn region phtmlComment		start="/\*" skip=">" end="\*/"  contained contains=phtmlTodo

" Function names
syn keyword phtmlFunctions  Abs Ada_Close Ada_Connect Ada_Exec Ada_FetchRow contained
syn keyword phtmlFunctions  Ada_FieldName Ada_FieldNum Ada_FieldType contained
syn keyword phtmlFunctions  Ada_FreeResult Ada_NumFields Ada_NumRows Ada_Result contained
syn keyword phtmlFunctions  Ada_ResultAll AddSlashes ASort BinDec Ceil ChDir contained
syn keyword phtmlFunctions  AdaGrp ChMod ChOwn Chop Chr ClearStack ClearStatCache contained
syn keyword phtmlFunctions  closeDir CloseLog Cos Count Crypt Date dbList  contained
syn keyword phtmlFunctions  dbmClose dbmDelete dbmExists dbmFetch dbmFirstKey contained
syn keyword phtmlFunctions  dbmInsert dbmNextKey dbmOpen dbmReplace DecBin DecHex contained
syn keyword phtmlFunctions  DecOct doubleval Echo End ereg eregi ereg_replace contained
syn keyword phtmlFunctions  eregi_replace EscapeShellCmd Eval Exec Exit Exp contained
syn keyword phtmlFunctions  fclose feof fgets fgetss File fileAtime fileCtime contained
syn keyword phtmlFunctions  fileGroup fileInode fileMtime fileOwner filePerms contained
syn keyword phtmlFunctions  fileSize fileType Floor Flush fopen fputs FPassThru contained
syn keyword phtmlFunctions  fseek fsockopen ftell getAccDir GetEnv getHostByName contained
syn keyword phtmlFunctions  getHostByAddr GetImageSize getLastAcess contained
syn keyword phtmlFunctions  getLastbrowser getLastEmail getLastHost getLastMod contained
syn keyword phtmlFunctions  getLastref getLogDir getMyInode getMyPid getMyUid contained
syn keyword phtmlFunctions  getRandMax getStartLogging getToday getTotal GetType contained
syn keyword phtmlFunctions  gmDate Header HexDec HtmlSpecialChars ImageArc contained
syn keyword phtmlFunctions  ImageChar ImageCharUp IamgeColorAllocate  contained
syn keyword phtmlFunctions  ImageColorTransparent ImageCopyResized ImageCreate contained
syn keyword phtmlFunctions  ImageCreateFromGif ImageDestroy ImageFill contained
syn keyword phtmlFunctions  ImageFilledPolygon ImageFilledRectangle contained
syn keyword phtmlFunctions  ImageFillToBorder ImageGif ImageInterlace ImageLine contained
syn keyword phtmlFunctions  ImagePolygon ImageRectangle ImageSetPixel  contained
syn keyword phtmlFunctions  ImageString ImageStringUp ImageSX ImageSY Include contained
syn keyword phtmlFunctions  InitSyslog intval IsSet Key Link LinkInfo Log Log10 contained
syn keyword phtmlFunctions  LosAs Mail Max Md5 mi_Close mi_Connect mi_DBname contained
syn keyword phtmlFunctions  mi_Exec mi_FieldName mi_FieldNum mi_NumFields contained
syn keyword phtmlFunctions  mi_NumRows mi_Result Microtime Min MkDir MkTime msql contained
syn keyword phtmlFunctions  msql_connect msql_CreateDB msql_dbName msql_DropDB contained
syn keyword phtmlFunctions  msqlFieldFlags msql_FieldLen msql_FieldName contained
syn keyword phtmlFunctions  msql_FieldType msql_FreeResult msql_ListDBs contained
syn keyword phtmlFunctions  msql_Listfields msql_ListTables msql_NumFields contained
syn keyword phtmlFunctions  msql_NumRows msql_RegCase msql_Result msql_TableName contained
syn keyword phtmlFunctions  mysql mysql_affected_rows mysql_close mysql_connect contained
syn keyword phtmlFunctions  mysql_CreateDB mysql_dbName mysqlDropDB  contained
syn keyword phtmlFunctions  mysql_FieldFlags mysql_FieldLen mysql_FieldName contained
syn keyword phtmlFunctions  mysql_FieldType mysql_FreeResult mysql_insert_id contained
syn keyword phtmlFunctions  mysql_listDBs mysql_Listfields mysql_ListTables contained
syn keyword phtmlFunctions  mysql_NumFields mysql_NumRows mysql_Result  contained
syn keyword phtmlFunctions  mysql_TableName Next OctDec openDir OpenLog  contained
syn keyword phtmlFunctions  Ora_Bind Ora_Close Ora_Commit Ora_CommitOff contained
syn keyword phtmlFunctions  Ora_CommitOn Ora_Exec Ora_Fetch Ora_GetColumn contained
syn keyword phtmlFunctions  Ora_Logoff Ora_Logon Ora_Parse Ora_Rollback Ord  contained
syn keyword phtmlFunctions  Parse_str PassThru pclose pg_Close pg_Connect contained
syn keyword phtmlFunctions  pg_DBname pg_ErrorMessage pg_Exec pg_FieldName contained
syn keyword phtmlFunctions  pg_FieldPrtLen pg_FieldNum pg_FieldSize  contained
syn keyword phtmlFunctions  pg_FieldType pg_FreeResult pg_GetLastOid pg_Host contained
syn keyword phtmlFunctions  pg_NumFields pg_NumRows pg_Options pg_Port  contained
syn keyword phtmlFunctions  pg_Result pg_tty phpInfo phpVersion popen pos pow contained
syn keyword phtmlFunctions  Prev PutEnv QuoteMeta Rand readDir ReadFile ReadLink contained
syn keyword phtmlFunctions  reg_Match reg_replace reg_Search Rename Reset return  contained
syn keyword phtmlFunctions  rewind rewindDir RmDir SetCookie SetErrorReporting contained
syn keyword phtmlFunctions  SetLogging SetShowInfo SetType shl shr Sin Sleep contained
syn keyword phtmlFunctions  Solid_Close Solid_Connect Solid_Exec Solid_FetchRow contained
syn keyword phtmlFunctions  Solid_FieldName Solid_FieldNum Solid_FreeResult  contained
syn keyword phtmlFunctions  Solid_NumFields Solid_NumRows Solid_Result Sort contained
syn keyword phtmlFunctions  Spundtex Sprintf Sqrt Srand strchr strtr  contained
syn keyword phtmlFunctions  StripSlashes strlen strchr strstr strtok strtolower contained
syn keyword phtmlFunctions  strtoupper strval substr sybSQL_CheckConnect contained
syn keyword phtmlFunctions  sybSQL_DBUSE sybSQL_Connect sybSQL_Exit contained
syn keyword phtmlFunctions  sybSQL_Fieldname sybSQL_GetField sybSQL_IsRow  contained
syn keyword phtmlFunctions  sybSQL_NextRow sybSQL_NumFields sybSQL_NumRows contained
syn keyword phtmlFunctions  sybSQL_Query sybSQL_Result sybSQL_Result sybSQL_Seek contained
syn keyword phtmlFunctions  Symlink syslog System Tan TempNam Time Umask UniqId contained
syn keyword phtmlFunctions  Unlink Unset UrlDecode UrlEncode USleep Virtual contained

" Identifier
syn match  phtmlIdentifier "$[a-zA-Z_][a-zA-Z0-9_]*" contained contains=phtmlEnvVar,phtmlIntVar

" Conditional
syn keyword phtmlConditional  if else elseif endif switch endswitch contained

" Repeat
syn keyword phtmlRepeat  while endwhile contained

" Repeat
syn keyword phtmlLabel  case default contained

" Statement
syn keyword phtmlStatement  break return continue exit contained

" Operator
syn match phtmlOperator  "[-=+%^&|*]" contained
syn match phtmlOperator  "[-+*/%^&|]=" contained
syn match phtmlOperator  "/[^*]"me=e-1 contained
syn match phtmlOperator  "/$" contained
syn match phtmlRelation  "&&" contained
syn match phtmlRelation  "||" contained
syn match phtmlRelation  "[!=<>]=" contained
syn match phtmlRelation  "[<>]" contained

" Include
syn keyword phtmlInclude  include contained

" Definesag
syn keyword phtmlDefine  Function contained

" String
syn region phtmlString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+  end=+"+ contains=phtmlIdentifier,phtmlSpecialChar contained

" Number
syn match phtmlNumber  "-\=\<\d\+\>" contained

" Float
syn match phtmlFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>" contained

" SpecialChar
syn match phtmlSpecialChar "\\[abcfnrtyv\\]" contained
syn match phtmlSpecialChar "\\\d\{3}" contained contains=phtmlOctalError
syn match phtmlSpecialChar "\\x[0-9a-fA-F]\{2}" contained

syn match phtmlOctalError "[89]" contained


syn match phtmlParentError "[)}\]]" contained

" Todo
syn keyword phtmlTodo TODO Todo todo contained

" Parents
syn region phtmlParent1	matchgroup=Delimiter start="(" end=")" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude
syn region phtmlParent2	matchgroup=Delimiter start="{" end="}" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude
syn region phtmlParent3	matchgroup=Delimiter start="\[" end="\]" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude

syn region phtmlRegion keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|".*>.*"+ end=">" contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlInclude,phtmlDefine,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParentError,phtmlTodo,phtmlParent1,phtmlParent2,phtmlParent3

if !exists("did_phtml_syntax_inits")
  let did_phtml_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  hi link phtmlComment                   Comment
  hi link phtmlString                    String
  hi link phtmlNumber                    Number
  hi link phtmlFloat                     Float
  hi phtmlIdentifier guifg=DarkGray ctermfg=Brown
  hi link phtmlFunctions                 Function
  hi link phtmlRepeat                    Repeat 
  hi link phtmlConditional               Conditional 
  hi link phtmlLabel                     Label
  hi link phtmlStatement                 Statement
  hi link phtmlType                      Type
  hi link phtmlInclude                   Include
  hi link phtmlDefine                    Define
  hi link phtmlSpecialChar               SpecialChar
  hi link phtmlParentError	         Error
  hi link phtmlOctalError	         Error
  hi link phtmlTodo                      Todo
  hi phtmlRelation guifg=SeaGreen ctermfg=DarkGreen
  hi phtmlOperator guifg=SeaGreen ctermfg=DarkGreen
  hi phtmlIntVar guifg=Red ctermfg=DarkRed
  hi phtmlEnvVar guifg=Red ctermfg=DarkRed
endif
 
let b:current_syntax = "phtml"

" vim: ts=8