1 " FILE: syntax/conque_term.vim {{{
2 " AUTHOR: Nico Raffo <nicoraffo@gmail.com>
3 " WEBSITE: http://conque.googlecode.com
5 " VERSION: 2.2, for Vim 7.0
7 " Conque - Vim terminal/console emulator
8 " Copyright (C) 2009-__YEAR__ Nico Raffo
12 " Permission is hereby granted, free of charge, to any person obtaining a copy
13 " of this software and associated documentation files (the "Software"), to deal
14 " in the Software without restriction, including without limitation the rights
15 " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 " copies of the Software, and to permit persons to whom the Software is
17 " furnished to do so, subject to the following conditions:
19 " The above copyright notice and this permission notice shall be included in
20 " all copies or substantial portions of the Software.
22 " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32 " *******************************************************************************************************************
33 " MySQL *************************************************************************************************************
34 " *******************************************************************************************************************
36 " TODO Move these to syntax which is only executed for mysql
37 "syn match MySQLTableBodyG "^\s*\w\+:\(.\+\)\=$" contains=MySQLTableHeadG,MySQLNullG,MySQLBool,MySQLNumberG,MySQLStorageClass oneline skipwhite skipnl
38 "syn match MySQLTableHeadG "^\s*\w\+:" contains=MySQLTableColon skipwhite contained
39 "syn match MySQLTableColon ":" contained
41 syn match MySQLTableHead "^ *|.*| *$" nextgroup=MySQLTableDivide contains=MySQLTableBar oneline skipwhite skipnl
42 syn match MySQLTableBody "^ *|.*| *$" nextgroup=MySQLTableBody,MySQLTableEnd contains=MySQLTableBar,MySQLNull,MySQLBool,MySQLNumber,MySQLStorageClass oneline skipwhite skipnl
43 syn match MySQLTableEnd "^ *+[+=-]\++ *$" oneline
44 syn match MySQLTableDivide "^ *+[+=-]\++ *$" nextgroup=MySQLTableBody oneline skipwhite skipnl
45 syn match MySQLTableStart "^ *+[+=-]\++ *$" nextgroup=MySQLTableHead oneline skipwhite skipnl
46 syn match MySQLNull " NULL " contained contains=MySQLTableBar
47 syn match MySQLStorageClass " PRI " contained
48 syn match MySQLStorageClass " MUL " contained
49 syn match MySQLStorageClass " UNI " contained
50 syn match MySQLStorageClass " CURRENT_TIMESTAMP " contained
51 syn match MySQLStorageClass " auto_increment " contained
52 syn match MySQLTableBar "|" contained
53 syn match MySQLNumber "|\? *\d\+\(\.\d\+\)\? *|" contained contains=MySQLTableBar
54 syn match MySQLQueryStat "^\d\+ rows\? in set.*" oneline
55 syn match MySQLPromptLine "^.\?mysql> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
56 syn match MySQLPromptLine "^ -> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
57 syn match MySQLPrompt "^.\?mysql>" contained oneline
58 syn match MySQLPrompt "^ ->" contained oneline
60 syn keyword MySQLKeyword select count max sum avg date show table tables status like as from left right outer inner join contained
61 syn keyword MySQLKeyword where group by having limit offset order desc asc show contained and interval is null on
63 syn region MySQLString start=+'+ end=+'+ skip=+\\'+ contained oneline
64 syn region MySQLString start=+"+ end=+"+ skip=+\\"+ contained oneline
65 syn region MySQLString start=+`+ end=+`+ skip=+\\`+ contained oneline
68 hi def link MySQLPrompt Identifier
69 hi def link MySQLTableHead Title
70 hi def link MySQLTableBody Normal
71 hi def link MySQLBool Boolean
72 hi def link MySQLStorageClass StorageClass
73 hi def link MySQLNumber Number
74 hi def link MySQLKeyword Keyword
75 hi def link MySQLString String
77 " terms which have no reasonable default highlight group to link to
78 hi MySQLTableHead term=bold cterm=bold gui=bold
79 if &background == 'dark'
80 hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
81 hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
82 hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
83 hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
84 hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
85 hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
86 elseif &background == 'light'
87 hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
88 hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
89 hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
90 hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
91 hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
92 hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
96 " *******************************************************************************************************************
97 " Bash **************************************************************************************************************
98 " *******************************************************************************************************************
101 if g:ConqueTerm_PromptRegex != ''
102 silent execute "syn match ConquePromptLine '" . g:ConqueTerm_PromptRegex . ".*$' contains=ConquePrompt,ConqueString oneline"
103 silent execute "syn match ConquePrompt '" . g:ConqueTerm_PromptRegex . "' contained oneline"
104 hi def link ConquePrompt Identifier
108 syn region ConqueString start=+'+ end=+'+ skip=+\\'+ contained oneline
109 syn region ConqueString start=+"+ end=+"+ skip=+\\"+ contained oneline
110 syn region ConqueString start=+`+ end=+`+ skip=+\\`+ contained oneline
111 hi def link ConqueString String
113 " vim: foldmethod=marker