mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 19:43:52 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab679f37dd | ||
|
|
ca95a47a93 | ||
|
|
a26bebbeb9 |
@@ -30,7 +30,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
||||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [css-color](https://github.com/ap/vim-css-color) (syntax)
|
- [css-color](https://github.com/gorodinskiy/vim-coloresque) (syntax)
|
||||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
" Language: Colorful CSS Color Preview
|
" Name: Coloresque
|
||||||
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
" Language: color preview in vim
|
||||||
" Last Change: 2013-03-09
|
" Author: Gorodinskii Konstantin <gor.konstantin@gmail.com>
|
||||||
" Licence: No Warranties. WTFPL. But please tell me!
|
" Licence: Vim license
|
||||||
" Version: 0.7.3
|
" Version: 0.9.5
|
||||||
|
" based on
|
||||||
|
" https://github.com/ap/vim-css-color
|
||||||
|
" https://github.com/lilydjwg/colorizer
|
||||||
" vim:et:ts=2 sw=2 sts=2
|
" vim:et:ts=2 sw=2 sts=2
|
||||||
"
|
|
||||||
" KNOWN PROBLEMS: compatibility with `cursorline` -- https://github.com/ap/vim-css-color/issues/24
|
|
||||||
|
|
||||||
let s:hex={}
|
let s:hex={}
|
||||||
|
let b:matchescache = {}
|
||||||
|
let b:color_pattern = {}
|
||||||
|
|
||||||
|
let w:colorDictRegExp=''
|
||||||
for i in range(0, 255)
|
for i in range(0, 255)
|
||||||
let s:hex[ printf( '%02x', i ) ] = i
|
let s:hex[ printf( '%02x', i ) ] = i
|
||||||
endfor
|
endfor
|
||||||
@@ -24,25 +29,52 @@ function! s:FGForBG(color)
|
|||||||
return r*30 + g*59 + b*11 > 12000 ? s:black : s:white
|
return r*30 + g*59 + b*11 > 12000 ? s:black : s:white
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let b:color_pattern = {}
|
|
||||||
let s:color_prefix = 'gui'
|
let s:color_prefix = 'gui'
|
||||||
let s:fg_color_calc = 'let color = "#" . toupper(a:color)'
|
let s:fg_color_calc = 'let color = "#" . toupper(a:color)'
|
||||||
|
|
||||||
function! s:MatchColorValue(color, pattern)
|
function! s:RestoreColors()
|
||||||
|
for part in keys(b:color_pattern)
|
||||||
|
|
||||||
|
"if b:color_pattern[part]=="ffffff"
|
||||||
|
"echoe part
|
||||||
|
"endif
|
||||||
|
|
||||||
|
call s:MatchColorValue(b:color_pattern[part], part)
|
||||||
|
"echoe color
|
||||||
|
"echoe b:color_pattern[color]
|
||||||
|
"let group = 'cssColor' . tolower(strpart(b:color_pattern[part]["color"], 1))
|
||||||
|
""exe 'syn match' group '/'.escape(pattern, '/').'/ contained'
|
||||||
|
"exe 'syn cluster cssColors add='.group
|
||||||
|
"exe 'hi' group s:color_prefix.'bg='.b:color_pattern[part]["bg"] s:color_prefix.'fg='.b:color_pattern[part]["fg"]
|
||||||
|
|
||||||
|
"if !exists('b:matchescache')
|
||||||
|
"let b:matchescache={}
|
||||||
|
"endif
|
||||||
|
|
||||||
|
"let b:matchescache[part] = matchadd(group, part, -1)
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:MatchColorValue(color, part)
|
||||||
if ! len(a:color) | return | endif
|
if ! len(a:color) | return | endif
|
||||||
|
|
||||||
if has_key( b:color_pattern, a:pattern ) | return | endif
|
|
||||||
let b:color_pattern[a:pattern] = 1
|
|
||||||
|
|
||||||
let pattern = a:pattern
|
|
||||||
" iff pattern ends on word character, require word break to match
|
|
||||||
if pattern =~ '\>$' | let pattern .= '\>' | endif
|
|
||||||
|
|
||||||
let group = 'cssColor' . tolower(a:color)
|
let group = 'cssColor' . tolower(a:color)
|
||||||
exe 'syn match' group '/'.escape(pattern, '/').'/ contained'
|
|
||||||
exe 'syn cluster cssColors add='.group
|
if !exists('b:color_pattern[a:part]')
|
||||||
exe s:fg_color_calc
|
exe s:fg_color_calc
|
||||||
|
exe 'syn cluster cssColors add='.group
|
||||||
exe 'hi' group s:color_prefix.'bg='.color s:color_prefix.'fg='.s:FGForBG(a:color)
|
exe 'hi' group s:color_prefix.'bg='.color s:color_prefix.'fg='.s:FGForBG(a:color)
|
||||||
|
let b:color_pattern[a:part] = a:color
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('b:matchescache')
|
||||||
|
let b:matchescache = {}
|
||||||
|
elseif !exists('b:matchescache[a:part]')
|
||||||
|
let b:matchescache[a:part] = matchadd(group, a:part, -1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
"call add(w:matchescache, matchadd(group, a:part, -1))
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -73,18 +105,265 @@ function! s:HexForHSLValue(h,s,l)
|
|||||||
return printf( '%02x%02x%02x', rgb[0], rgb[1], rgb[2] )
|
return printf( '%02x%02x%02x', rgb[0], rgb[1], rgb[2] )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:PreviewCSSColorInLine()
|
function! s:ClearMatches()
|
||||||
" TODO use cssColor matchdata
|
call clearmatches()
|
||||||
"
|
|
||||||
" N.B. these substitute() calls are here just for the side effect
|
if !exists('b:matchescache')
|
||||||
" of invoking s:MatchColorValue during substitution -- because
|
return
|
||||||
" match() and friends do not allow finding all matches in a single
|
endif
|
||||||
" scan without examining the start of the string over and over
|
"for i in values(b:matchescache)
|
||||||
call substitute( substitute( substitute( substitute( getline('.'),
|
"call matchdelete(i)
|
||||||
\ '#\(\x\)\(\x\)\(\x\)\>', '\=s:MatchColorValue(submatch(1).submatch(1).submatch(2).submatch(2).submatch(3).submatch(3), submatch(0))', 'g' ),
|
"endfor
|
||||||
\ '#\(\x\{6}\)\>', '\=s:MatchColorValue(submatch(1), submatch(0))', 'g' ),
|
unlet b:matchescache
|
||||||
\ 'rgba\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)', '\=s:MatchColorValue(s:HexForRGBValue(submatch(1),submatch(2),submatch(3)),submatch(0))', 'g' ),
|
endfunction
|
||||||
\ 'hsla\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)', '\=s:MatchColorValue(s:HexForHSLValue(submatch(1),submatch(2),submatch(3)),submatch(0))', 'g' )
|
|
||||||
|
function! s:VimCssInit(update)
|
||||||
|
|
||||||
|
if a:update==1
|
||||||
|
call s:ClearMatches()
|
||||||
|
endif
|
||||||
|
:set isk+=-
|
||||||
|
:set isk+=#
|
||||||
|
:set isk+=.
|
||||||
|
|
||||||
|
if len(keys(b:color_pattern))>0
|
||||||
|
call s:RestoreColors()
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
"let b:matchescache = {}
|
||||||
|
|
||||||
|
call s:AdditionalColors()
|
||||||
|
|
||||||
|
"for i in range(1, line("$"))
|
||||||
|
call s:PreviewCSSColor(join(getline(1,'$'), "\n"))
|
||||||
|
"endfor
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:AdditionalColors()
|
||||||
|
"if exists('&b:colorDictRegExp')&&b:colorDictRegExp!=''
|
||||||
|
"return
|
||||||
|
"endif
|
||||||
|
|
||||||
|
" w3c Colors
|
||||||
|
" plus extra colors
|
||||||
|
let w:colorDict = {
|
||||||
|
\'black': '#000000',
|
||||||
|
\'red': '#ff0000',
|
||||||
|
\'silver': '#c0c0c0',
|
||||||
|
\'gray': '#808080',
|
||||||
|
\'white': '#ffffff',
|
||||||
|
\'maroon': '#800000',
|
||||||
|
\'purple': '#800080',
|
||||||
|
\'fuchsia': '#ff00ff',
|
||||||
|
\'green': '#008000',
|
||||||
|
\'lime': '#00ff00',
|
||||||
|
\'olive': '#808000',
|
||||||
|
\'yellow': '#ffff00',
|
||||||
|
\'navy': '#000080',
|
||||||
|
\'blue': '#0000ff',
|
||||||
|
\'teal': '#008080',
|
||||||
|
\'aqua': '#00ffff',
|
||||||
|
\'aliceblue': '#f0f8ff',
|
||||||
|
\'antiquewhite': '#faebd7',
|
||||||
|
\'aquamarine': '#7fffd4',
|
||||||
|
\'azure': '#f0ffff',
|
||||||
|
\'beige': '#f5f5dc',
|
||||||
|
\'bisque': '#ffe4c4',
|
||||||
|
\'blanchedalmond': '#ffebcd',
|
||||||
|
\'blueviolet': '#8a2be2',
|
||||||
|
\'brown': '#a52a2a',
|
||||||
|
\'burlywood': '#deb887',
|
||||||
|
\'cadetblue': '#5f9ea0',
|
||||||
|
\'chartreuse': '#7fff00',
|
||||||
|
\'chocolate': '#d2691e',
|
||||||
|
\'coral': '#ff7f50',
|
||||||
|
\'cornflowerblue': '#6495ed',
|
||||||
|
\'cornsilk': '#fff8dc',
|
||||||
|
\'crimson': '#dc143c',
|
||||||
|
\'cyan': '#00ffff',
|
||||||
|
\'darkblue': '#00008b',
|
||||||
|
\'darkcyan': '#008b8b',
|
||||||
|
\'darkgoldenrod': '#b8860b',
|
||||||
|
\'darkgray': '#a9a9a9',
|
||||||
|
\'darkgreen': '#006400',
|
||||||
|
\'darkgrey': '#a9a9a9',
|
||||||
|
\'darkkhaki': '#bdb76b',
|
||||||
|
\'darkmagenta': '#8b008b',
|
||||||
|
\'darkolivegreen': '#556b2f',
|
||||||
|
\'darkorchid': '#9932cc',
|
||||||
|
\'darkred': '#8b0000',
|
||||||
|
\'darksalmon': '#e9967a',
|
||||||
|
\'darkseagreen': '#8fbc8f',
|
||||||
|
\'darkslateblue': '#483d8b',
|
||||||
|
\'darkslategray': '#2f4f4f',
|
||||||
|
\'darkslategrey': '#2f4f4f',
|
||||||
|
\'darkturquoise': '#00ced1',
|
||||||
|
\'darkviolet': '#9400d3',
|
||||||
|
\'darkorange': '#ff8c00',
|
||||||
|
\'deeppink': '#ff1493',
|
||||||
|
\'deepskyblue': '#00bfff',
|
||||||
|
\'dimgray': '#696969',
|
||||||
|
\'dimgrey': '#696969',
|
||||||
|
\'dodgerblue': '#1e90ff',
|
||||||
|
\'firebrick': '#b22222',
|
||||||
|
\'floralwhite': '#fffaf0',
|
||||||
|
\'forestgreen': '#228b22',
|
||||||
|
\'gainsboro': '#dcdcdc',
|
||||||
|
\'ghostwhite': '#f8f8ff',
|
||||||
|
\'gold': '#ffd700',
|
||||||
|
\'goldenrod': '#daa520',
|
||||||
|
\'greenyellow': '#adff2f',
|
||||||
|
\'grey': '#808080',
|
||||||
|
\'honeydew': '#f0fff0',
|
||||||
|
\'hotpink': '#ff69b4',
|
||||||
|
\'indianred': '#cd5c5c',
|
||||||
|
\'indigo': '#4b0082',
|
||||||
|
\'ivory': '#fffff0',
|
||||||
|
\'khaki': '#f0e68c',
|
||||||
|
\'lavender': '#e6e6fa',
|
||||||
|
\'lavenderblush': '#fff0f5',
|
||||||
|
\'lawngreen': '#7cfc00',
|
||||||
|
\'lemonchiffon': '#fffacd',
|
||||||
|
\'lightblue': '#add8e6',
|
||||||
|
\'lightcoral': '#f08080',
|
||||||
|
\'lightcyan': '#e0ffff',
|
||||||
|
\'lightgoldenrodyellow': '#fafad2',
|
||||||
|
\'lightgray': '#d3d3d3',
|
||||||
|
\'lightgreen': '#90ee90',
|
||||||
|
\'lightgrey': '#d3d3d3',
|
||||||
|
\'lightpink': '#ffb6c1',
|
||||||
|
\'lightsalmon': '#ffa07a',
|
||||||
|
\'lightseagreen': '#20b2aa',
|
||||||
|
\'lightskyblue': '#87cefa',
|
||||||
|
\'lightslategray': '#778899',
|
||||||
|
\'lightslategrey': '#778899',
|
||||||
|
\'lightsteelblue': '#b0c4de',
|
||||||
|
\'lightyellow': '#ffffe0',
|
||||||
|
\'limegreen': '#32cd32',
|
||||||
|
\'linen': '#faf0e6',
|
||||||
|
\'magenta': '#ff00ff',
|
||||||
|
\'mediumaquamarine': '#66cdaa',
|
||||||
|
\'mediumblue': '#0000cd',
|
||||||
|
\'mediumorchid': '#ba55d3',
|
||||||
|
\'mediumpurple': '#9370d8',
|
||||||
|
\'mediumseagreen': '#3cb371',
|
||||||
|
\'mediumslateblue': '#7b68ee',
|
||||||
|
\'mediumspringgreen': '#00fa9a',
|
||||||
|
\'mediumturquoise': '#48d1cc',
|
||||||
|
\'mediumvioletred': '#c71585',
|
||||||
|
\'midnightblue': '#191970',
|
||||||
|
\'mintcream': '#f5fffa',
|
||||||
|
\'mistyrose': '#ffe4e1',
|
||||||
|
\'moccasin': '#ffe4b5',
|
||||||
|
\'navajowhite': '#ffdead',
|
||||||
|
\'oldlace': '#fdf5e6',
|
||||||
|
\'olivedrab': '#6b8e23',
|
||||||
|
\'orange': '#ffa500',
|
||||||
|
\'orangered': '#ff4500',
|
||||||
|
\'orchid': '#da70d6',
|
||||||
|
\'palegoldenrod': '#eee8aa',
|
||||||
|
\'palegreen': '#98fb98',
|
||||||
|
\'paleturquoise': '#afeeee',
|
||||||
|
\'palevioletred': '#d87093',
|
||||||
|
\'papayawhip': '#ffefd5',
|
||||||
|
\'peachpuff': '#ffdab9',
|
||||||
|
\'peru': '#cd853f',
|
||||||
|
\'pink': '#ffc0cb',
|
||||||
|
\'plum': '#dda0dd',
|
||||||
|
\'powderblue': '#b0e0e6',
|
||||||
|
\'rosybrown': '#bc8f8f',
|
||||||
|
\'royalblue': '#4169e1',
|
||||||
|
\'saddlebrown': '#8b4513',
|
||||||
|
\'salmon': '#fa8072',
|
||||||
|
\'sandybrown': '#f4a460',
|
||||||
|
\'seagreen': '#2e8b57',
|
||||||
|
\'seashell': '#fff5ee',
|
||||||
|
\'sienna': '#a0522d',
|
||||||
|
\'skyblue': '#87ceeb',
|
||||||
|
\'slateblue': '#6a5acd',
|
||||||
|
\'slategray': '#708090',
|
||||||
|
\'slategrey': '#708090',
|
||||||
|
\'snow': '#fffafa',
|
||||||
|
\'springgreen': '#00ff7f',
|
||||||
|
\'steelblue': '#4682b4',
|
||||||
|
\'tan': '#d2b48c',
|
||||||
|
\'thistle': '#d8bfd8',
|
||||||
|
\'tomato': '#ff6347',
|
||||||
|
\'turquoise': '#40e0d0',
|
||||||
|
\'violet': '#ee82ee',
|
||||||
|
\'wheat': '#f5deb3',
|
||||||
|
\'whitesmoke': '#f5f5f5',
|
||||||
|
\'yellowgreen': '#9acd32'
|
||||||
|
\}
|
||||||
|
|
||||||
|
"let w:colorDictRegExp = '\('
|
||||||
|
for _color in keys(w:colorDict)
|
||||||
|
"let w:colorDictRegExp.='\<'._color.'\>\|'
|
||||||
|
call s:MatchColorValue(strpart(w:colorDict[tolower(_color)], 1), '\<\c'._color.'\>')
|
||||||
|
endfor
|
||||||
|
"let w:colorDictRegExp=strpart(w:colorDictRegExp, 0, len(w:colorDictRegExp)-2).'\)\c'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:ProcessByLine(w)
|
||||||
|
call s:PreviewCSSColor(getline(a:w))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:PreviewCSSColor(str)
|
||||||
|
"if !exists('&w:colorDictRegExp')
|
||||||
|
"endif
|
||||||
|
|
||||||
|
let line=a:str "getline(a:w)
|
||||||
|
let colorexps = {
|
||||||
|
\ 'hex' : '#[0-9A-Fa-f]\{3\}\>\|#[0-9A-Fa-f]\{6\}\>',
|
||||||
|
\ 'rgba' : 'rgba\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)',
|
||||||
|
\ 'hsla' : 'hsla\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)'
|
||||||
|
\ }
|
||||||
|
"\ 'color': w:colorDictRegExp
|
||||||
|
|
||||||
|
"let foundcolor=''
|
||||||
|
|
||||||
|
for exp in keys(colorexps)
|
||||||
|
let place=0
|
||||||
|
|
||||||
|
if exists("foundcolor")
|
||||||
|
unlet foundcolor
|
||||||
|
endif
|
||||||
|
|
||||||
|
while 1
|
||||||
|
if exp=='rgba'||exp=='hsla'
|
||||||
|
let foundcolor = matchlist(a:str, colorexps[exp], place)
|
||||||
|
else
|
||||||
|
let foundcolor = matchstr(a:str, colorexps[exp], place)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let place = matchend(a:str, colorexps[exp], place)
|
||||||
|
|
||||||
|
if empty(foundcolor)
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exp=='hex'
|
||||||
|
let part = foundcolor.'\>'
|
||||||
|
else
|
||||||
|
let part = foundcolor[0]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exp=='hex'
|
||||||
|
if len(foundcolor) == 4
|
||||||
|
let foundcolor = substitute(foundcolor, '[[:xdigit:]]', '&&', 'g')
|
||||||
|
endif
|
||||||
|
call s:MatchColorValue(strpart(foundcolor, 1), part)
|
||||||
|
elseif exp=='rgba'
|
||||||
|
"TODO get rid of duplicated variables
|
||||||
|
call s:MatchColorValue(s:HexForRGBValue(foundcolor[1], foundcolor[2], foundcolor[3]), part)
|
||||||
|
elseif exp=='hsla'
|
||||||
|
call s:MatchColorValue(s:HexForHSLValue(foundcolor[1], foundcolor[2], foundcolor[3]), part)
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
endfor
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if has("gui_running") || &t_Co==256
|
if has("gui_running") || &t_Co==256
|
||||||
@@ -97,7 +376,6 @@ if has("gui_running") || &t_Co==256
|
|||||||
if out !~ '^cssDefinition ' | continue | endif
|
if out !~ '^cssDefinition ' | continue | endif
|
||||||
let out = substitute( out, ' \+xxx \+', ' ', '' )
|
let out = substitute( out, ' \+xxx \+', ' ', '' )
|
||||||
let out = substitute( out, ' contains=\zs', '@cssColors,', '' )
|
let out = substitute( out, ' contains=\zs', '@cssColors,', '' )
|
||||||
syn clear cssDefinition
|
|
||||||
exe 'syn region' out
|
exe 'syn region' out
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
@@ -341,161 +619,14 @@ if has("gui_running") || &t_Co==256
|
|||||||
hi cssColorfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16 | syn cluster cssColors add=cssColorfffff0
|
hi cssColorfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16 | syn cluster cssColors add=cssColorfffff0
|
||||||
hi cssColorffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16 | syn cluster cssColors add=cssColorffffff
|
hi cssColorffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16 | syn cluster cssColors add=cssColorffffff
|
||||||
|
|
||||||
" w3c Colors
|
"call s:VimCssInit(1)
|
||||||
syn keyword cssColor000000 black contained
|
|
||||||
syn keyword cssColorc0c0c0 silver contained
|
|
||||||
syn keyword cssColor808080 gray contained
|
|
||||||
syn match cssColorffffff "\<white\(-\)\@!\>" contained
|
|
||||||
syn keyword cssColor800000 maroon contained
|
|
||||||
syn keyword cssColorff0000 red contained
|
|
||||||
syn keyword cssColor800080 purple contained
|
|
||||||
syn keyword cssColorff00ff fuchsia contained
|
|
||||||
syn keyword cssColor008000 green contained
|
|
||||||
syn keyword cssColor00ff00 lime contained
|
|
||||||
syn keyword cssColor808000 olive contained
|
|
||||||
syn keyword cssColorffff00 yellow contained
|
|
||||||
syn keyword cssColor000080 navy contained
|
|
||||||
syn keyword cssColor0000ff blue contained
|
|
||||||
syn keyword cssColor008080 teal contained
|
|
||||||
syn keyword cssColor00ffff aqua contained
|
|
||||||
|
|
||||||
" extra colors
|
":augroup css
|
||||||
syn keyword cssColorf0f8ff AliceBlue contained
|
"au!
|
||||||
syn keyword cssColorfaebd7 AntiqueWhite contained
|
autocmd CursorMovedI <buffer> silent call s:ProcessByLine('.')
|
||||||
syn keyword cssColor7fffd4 Aquamarine contained
|
autocmd ColorScheme <buffer> silent call s:VimCssInit(1)
|
||||||
syn keyword cssColorf0ffff Azure contained
|
autocmd BufEnter <buffer> silent call s:VimCssInit(1)
|
||||||
syn keyword cssColorf5f5dc Beige contained
|
":augroup END
|
||||||
syn keyword cssColorffe4c4 Bisque contained
|
|
||||||
syn keyword cssColorffebcd BlanchedAlmond contained
|
|
||||||
syn keyword cssColor8a2be2 BlueViolet contained
|
|
||||||
syn keyword cssColora52a2a Brown contained
|
|
||||||
syn keyword cssColordeb887 BurlyWood contained
|
|
||||||
syn keyword cssColor5f9ea0 CadetBlue contained
|
|
||||||
syn keyword cssColor7fff00 Chartreuse contained
|
|
||||||
syn keyword cssColord2691e Chocolate contained
|
|
||||||
syn keyword cssColorff7f50 Coral contained
|
|
||||||
syn keyword cssColor6495ed CornflowerBlue contained
|
|
||||||
syn keyword cssColorfff8dc Cornsilk contained
|
|
||||||
syn keyword cssColordc143c Crimson contained
|
|
||||||
syn keyword cssColor00ffff Cyan contained
|
|
||||||
syn keyword cssColor00008b DarkBlue contained
|
|
||||||
syn keyword cssColor008b8b DarkCyan contained
|
|
||||||
syn keyword cssColorb8860b DarkGoldenRod contained
|
|
||||||
syn keyword cssColora9a9a9 DarkGray contained
|
|
||||||
syn keyword cssColor006400 DarkGreen contained
|
|
||||||
syn keyword cssColora9a9a9 DarkGrey contained
|
|
||||||
syn keyword cssColorbdb76b DarkKhaki contained
|
|
||||||
syn keyword cssColor8b008b DarkMagenta contained
|
|
||||||
syn keyword cssColor556b2f DarkOliveGreen contained
|
|
||||||
syn keyword cssColor9932cc DarkOrchid contained
|
|
||||||
syn keyword cssColor8b0000 DarkRed contained
|
|
||||||
syn keyword cssColore9967a DarkSalmon contained
|
|
||||||
syn keyword cssColor8fbc8f DarkSeaGreen contained
|
|
||||||
syn keyword cssColor483d8b DarkSlateBlue contained
|
|
||||||
syn keyword cssColor2f4f4f DarkSlateGray contained
|
|
||||||
syn keyword cssColor2f4f4f DarkSlateGrey contained
|
|
||||||
syn keyword cssColor00ced1 DarkTurquoise contained
|
|
||||||
syn keyword cssColor9400d3 DarkViolet contained
|
|
||||||
syn keyword cssColorff8c00 Darkorange contained
|
|
||||||
syn keyword cssColorff1493 DeepPink contained
|
|
||||||
syn keyword cssColor00bfff DeepSkyBlue contained
|
|
||||||
syn keyword cssColor696969 DimGray contained
|
|
||||||
syn keyword cssColor696969 DimGrey contained
|
|
||||||
syn keyword cssColor1e90ff DodgerBlue contained
|
|
||||||
syn keyword cssColorb22222 FireBrick contained
|
|
||||||
syn keyword cssColorfffaf0 FloralWhite contained
|
|
||||||
syn keyword cssColor228b22 ForestGreen contained
|
|
||||||
syn keyword cssColordcdcdc Gainsboro contained
|
|
||||||
syn keyword cssColorf8f8ff GhostWhite contained
|
|
||||||
syn keyword cssColorffd700 Gold contained
|
|
||||||
syn keyword cssColordaa520 GoldenRod contained
|
|
||||||
syn keyword cssColoradff2f GreenYellow contained
|
|
||||||
syn keyword cssColor808080 Grey contained
|
|
||||||
syn keyword cssColorf0fff0 HoneyDew contained
|
|
||||||
syn keyword cssColorff69b4 HotPink contained
|
|
||||||
syn keyword cssColorcd5c5c IndianRed contained
|
|
||||||
syn keyword cssColor4b0082 Indigo contained
|
|
||||||
syn keyword cssColorfffff0 Ivory contained
|
|
||||||
syn keyword cssColorf0e68c Khaki contained
|
|
||||||
syn keyword cssColore6e6fa Lavender contained
|
|
||||||
syn keyword cssColorfff0f5 LavenderBlush contained
|
|
||||||
syn keyword cssColor7cfc00 LawnGreen contained
|
|
||||||
syn keyword cssColorfffacd LemonChiffon contained
|
|
||||||
syn keyword cssColoradd8e6 LightBlue contained
|
|
||||||
syn keyword cssColorf08080 LightCoral contained
|
|
||||||
syn keyword cssColore0ffff LightCyan contained
|
|
||||||
syn keyword cssColorfafad2 LightGoldenRodYellow contained
|
|
||||||
syn keyword cssColord3d3d3 LightGray contained
|
|
||||||
syn keyword cssColor90ee90 LightGreen contained
|
|
||||||
syn keyword cssColord3d3d3 LightGrey contained
|
|
||||||
syn keyword cssColorffb6c1 LightPink contained
|
|
||||||
syn keyword cssColorffa07a LightSalmon contained
|
|
||||||
syn keyword cssColor20b2aa LightSeaGreen contained
|
|
||||||
syn keyword cssColor87cefa LightSkyBlue contained
|
|
||||||
syn keyword cssColor778899 LightSlateGray contained
|
|
||||||
syn keyword cssColor778899 LightSlateGrey contained
|
|
||||||
syn keyword cssColorb0c4de LightSteelBlue contained
|
|
||||||
syn keyword cssColorffffe0 LightYellow contained
|
|
||||||
syn keyword cssColor32cd32 LimeGreen contained
|
|
||||||
syn keyword cssColorfaf0e6 Linen contained
|
|
||||||
syn keyword cssColorff00ff Magenta contained
|
|
||||||
syn keyword cssColor66cdaa MediumAquaMarine contained
|
|
||||||
syn keyword cssColor0000cd MediumBlue contained
|
|
||||||
syn keyword cssColorba55d3 MediumOrchid contained
|
|
||||||
syn keyword cssColor9370d8 MediumPurple contained
|
|
||||||
syn keyword cssColor3cb371 MediumSeaGreen contained
|
|
||||||
syn keyword cssColor7b68ee MediumSlateBlue contained
|
|
||||||
syn keyword cssColor00fa9a MediumSpringGreen contained
|
|
||||||
syn keyword cssColor48d1cc MediumTurquoise contained
|
|
||||||
syn keyword cssColorc71585 MediumVioletRed contained
|
|
||||||
syn keyword cssColor191970 MidnightBlue contained
|
|
||||||
syn keyword cssColorf5fffa MintCream contained
|
|
||||||
syn keyword cssColorffe4e1 MistyRose contained
|
|
||||||
syn keyword cssColorffe4b5 Moccasin contained
|
|
||||||
syn keyword cssColorffdead NavajoWhite contained
|
|
||||||
syn keyword cssColorfdf5e6 OldLace contained
|
|
||||||
syn keyword cssColor6b8e23 OliveDrab contained
|
|
||||||
syn keyword cssColorffa500 Orange contained
|
|
||||||
syn keyword cssColorff4500 OrangeRed contained
|
|
||||||
syn keyword cssColorda70d6 Orchid contained
|
|
||||||
syn keyword cssColoreee8aa PaleGoldenRod contained
|
|
||||||
syn keyword cssColor98fb98 PaleGreen contained
|
|
||||||
syn keyword cssColorafeeee PaleTurquoise contained
|
|
||||||
syn keyword cssColord87093 PaleVioletRed contained
|
|
||||||
syn keyword cssColorffefd5 PapayaWhip contained
|
|
||||||
syn keyword cssColorffdab9 PeachPuff contained
|
|
||||||
syn keyword cssColorcd853f Peru contained
|
|
||||||
syn keyword cssColorffc0cb Pink contained
|
|
||||||
syn keyword cssColordda0dd Plum contained
|
|
||||||
syn keyword cssColorb0e0e6 PowderBlue contained
|
|
||||||
syn keyword cssColorbc8f8f RosyBrown contained
|
|
||||||
syn keyword cssColor4169e1 RoyalBlue contained
|
|
||||||
syn keyword cssColor8b4513 SaddleBrown contained
|
|
||||||
syn keyword cssColorfa8072 Salmon contained
|
|
||||||
syn keyword cssColorf4a460 SandyBrown contained
|
|
||||||
syn keyword cssColor2e8b57 SeaGreen contained
|
|
||||||
syn keyword cssColorfff5ee SeaShell contained
|
|
||||||
syn keyword cssColora0522d Sienna contained
|
|
||||||
syn keyword cssColor87ceeb SkyBlue contained
|
|
||||||
syn keyword cssColor6a5acd SlateBlue contained
|
|
||||||
syn keyword cssColor708090 SlateGray contained
|
|
||||||
syn keyword cssColor708090 SlateGrey contained
|
|
||||||
syn keyword cssColorfffafa Snow contained
|
|
||||||
syn keyword cssColor00ff7f SpringGreen contained
|
|
||||||
syn keyword cssColor4682b4 SteelBlue contained
|
|
||||||
syn keyword cssColord2b48c Tan contained
|
|
||||||
syn keyword cssColord8bfd8 Thistle contained
|
|
||||||
syn keyword cssColorff6347 Tomato contained
|
|
||||||
syn keyword cssColor40e0d0 Turquoise contained
|
|
||||||
syn keyword cssColoree82ee Violet contained
|
|
||||||
syn keyword cssColorf5deb3 Wheat contained
|
|
||||||
syn keyword cssColorf5f5f5 WhiteSmoke contained
|
|
||||||
syn keyword cssColor9acd32 YellowGreen contained
|
|
||||||
|
|
||||||
let view = winsaveview()
|
"autocmd CursorMoved <buffer> silent call s:ProcessByLine('.')
|
||||||
%call s:PreviewCSSColorInLine()
|
|
||||||
call winrestview(view)
|
|
||||||
|
|
||||||
autocmd CursorMoved <buffer> silent call s:PreviewCSSColorInLine()
|
|
||||||
autocmd CursorMovedI <buffer> silent call s:PreviewCSSColorInLine()
|
|
||||||
endif
|
endif
|
||||||
@@ -9,3 +9,4 @@ syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
|
|||||||
\ end=#</script>#me=s-1 keepend
|
\ end=#</script>#me=s-1 keepend
|
||||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||||
\ containedin=htmlHead
|
\ containedin=htmlHead
|
||||||
|
syn include syntax/css/vim-coloresque.vim
|
||||||
|
|||||||
1
after/syntax/less.vim
Normal file
1
after/syntax/less.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
syn include syntax/css/vim-coloresque.vim
|
||||||
@@ -1 +1 @@
|
|||||||
syn cluster sassCssAttributes add=@cssColors
|
syn include syntax/css/vim-coloresque.vim
|
||||||
|
|||||||
1
after/syntax/scss.vim
Normal file
1
after/syntax/scss.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
syn include syntax/css/vim-coloresque.vim
|
||||||
@@ -1 +1 @@
|
|||||||
syn cluster stylusCssAttributes add=@cssColors
|
syn include syntax/css/vim-coloresque.vim
|
||||||
|
|||||||
1
after/syntax/vim.vim
Normal file
1
after/syntax/vim.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
syn include syntax/css/vim-coloresque.vim
|
||||||
5
build
5
build
@@ -54,7 +54,8 @@ copy_dir() {
|
|||||||
for file in $(find "$1/$2" -name '*.vim'); do
|
for file in $(find "$1/$2" -name '*.vim'); do
|
||||||
file_path="$(dirname "${file##$1/}")"
|
file_path="$(dirname "${file##$1/}")"
|
||||||
mkdir -p "$file_path"
|
mkdir -p "$file_path"
|
||||||
cp $file $file_path/
|
touch "$file_path/$(basename "$file")"
|
||||||
|
cat $file >> $file_path/$(basename "$file")
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +71,6 @@ PACKS="
|
|||||||
c/c++:vim-jp/cpp-vim
|
c/c++:vim-jp/cpp-vim
|
||||||
clojure:guns/vim-clojure-static
|
clojure:guns/vim-clojure-static
|
||||||
coffee-script:kchmck/vim-coffee-script
|
coffee-script:kchmck/vim-coffee-script
|
||||||
css-color:ap/vim-css-color
|
|
||||||
csv:chrisbra/csv.vim
|
csv:chrisbra/csv.vim
|
||||||
cucumber:tpope/vim-cucumber
|
cucumber:tpope/vim-cucumber
|
||||||
dockerfile:honza/dockerfile.vim
|
dockerfile:honza/dockerfile.vim
|
||||||
@@ -112,6 +112,7 @@ PACKS="
|
|||||||
vbnet:vim-scripts/vbnet.vim
|
vbnet:vim-scripts/vbnet.vim
|
||||||
twig:beyondwords/vim-twig
|
twig:beyondwords/vim-twig
|
||||||
xls:vim-scripts/XSLT-syntax
|
xls:vim-scripts/XSLT-syntax
|
||||||
|
css-color:gorodinskiy/vim-coloresque
|
||||||
"
|
"
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ augroup CoffeeUpdateMakePrg
|
|||||||
|
|
||||||
" Set autocmd locally if compiler was set locally.
|
" Set autocmd locally if compiler was set locally.
|
||||||
if &l:makeprg =~ s:pat
|
if &l:makeprg =~ s:pat
|
||||||
autocmd BufFilePost,BufWritePost <buffer> call s:UpdateMakePrg()
|
autocmd BufWritePre,BufFilePost <buffer> call s:UpdateMakePrg()
|
||||||
else
|
else
|
||||||
autocmd BufFilePost,BufWritePost call s:UpdateMakePrg()
|
autocmd BufWritePre,BufFilePost call s:UpdateMakePrg()
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|||||||
30
compiler/go.vim
Normal file
30
compiler/go.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Copyright 2013 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
" compiler/go.vim: Vim compiler file for Go.
|
||||||
|
|
||||||
|
if exists("current_compiler")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let current_compiler = "go"
|
||||||
|
|
||||||
|
if exists(":CompilerSet") != 2
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
CompilerSet makeprg=go\ build
|
||||||
|
CompilerSet errorformat=
|
||||||
|
\%-G#\ %.%#,
|
||||||
|
\%A%f:%l:%c:\ %m,
|
||||||
|
\%A%f:%l:\ %m,
|
||||||
|
\%C%*\\s%m,
|
||||||
|
\%-G%.%#
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
@@ -23,9 +23,8 @@ setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$
|
|||||||
" of user-defined def* definitions.
|
" of user-defined def* definitions.
|
||||||
setlocal define=\\v[(/]def(ault)@!\\S*
|
setlocal define=\\v[(/]def(ault)@!\\S*
|
||||||
|
|
||||||
" Remove 't' from 'formatoptions' to avoid auto-wrapping code. The '+=croql'
|
" Remove 't' from 'formatoptions' to avoid auto-wrapping code.
|
||||||
" is standard ftplugin boilerplate, although it is arguably intrusive.
|
setlocal formatoptions-=t
|
||||||
setlocal formatoptions-=t formatoptions+=croql
|
|
||||||
|
|
||||||
" Lisp comments are routinely nested (e.g. ;;; SECTION HEADING)
|
" Lisp comments are routinely nested (e.g. ;;; SECTION HEADING)
|
||||||
setlocal comments=n:;
|
setlocal comments=n:;
|
||||||
|
|||||||
@@ -1606,6 +1606,9 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
|||||||
let qty = len(data)
|
let qty = len(data)
|
||||||
let res = {}
|
let res = {}
|
||||||
for item in data
|
for item in data
|
||||||
|
if empty(item)
|
||||||
|
let item = 'NULL'
|
||||||
|
endif
|
||||||
if !get(res, item)
|
if !get(res, item)
|
||||||
let res[item] = 0
|
let res[item] = 0
|
||||||
endif
|
endif
|
||||||
@@ -1613,6 +1616,7 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
let max_items = reverse(sort(values(res)))
|
let max_items = reverse(sort(values(res)))
|
||||||
|
let count_items = keys(res)
|
||||||
if len(max_items) > 5
|
if len(max_items) > 5
|
||||||
call remove(max_items, 5, -1)
|
call remove(max_items, 5, -1)
|
||||||
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
||||||
@@ -1623,9 +1627,9 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
|||||||
else
|
else
|
||||||
let title="Nr\tCount\tValue"
|
let title="Nr\tCount\tValue"
|
||||||
endif
|
endif
|
||||||
echohl "Title"
|
echohl Title
|
||||||
echo printf("%s", title)
|
echo printf("%s", title)
|
||||||
echohl "Normal"
|
echohl Normal
|
||||||
echo printf("%s", repeat('=', strdisplaywidth(title)))
|
echo printf("%s", repeat('=', strdisplaywidth(title)))
|
||||||
|
|
||||||
let i=1
|
let i=1
|
||||||
@@ -1650,6 +1654,8 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
echo printf("%s", repeat('=', strdisplaywidth(title)))
|
||||||
|
echo printf("different values: %d", len(count_items))
|
||||||
unlet max_items
|
unlet max_items
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|||||||
17
ftplugin/go.vim
Normal file
17
ftplugin/go.vim
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
" Copyright 2013 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
" go.vim: Vim filetype plugin for Go.
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||||
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl com< cms<"
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Markdown
|
" Language: Markdown
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
|
" Last Change: 2013 May 30
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
|
|||||||
|
|
||||||
" proper matching for matchit plugin
|
" proper matching for matchit plugin
|
||||||
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
|
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
|
||||||
|
let b:match_words = '\<if\>:\<elsif\>:\<else\>'
|
||||||
|
|
||||||
" Restore the saved compatibility options.
|
" Restore the saved compatibility options.
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ setlocal softtabstop=2
|
|||||||
setlocal expandtab
|
setlocal expandtab
|
||||||
setlocal formatoptions=tcqr
|
setlocal formatoptions=tcqr
|
||||||
setlocal commentstring=//%s
|
setlocal commentstring=//%s
|
||||||
|
let &l:include = '^\s*import'
|
||||||
|
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'
|
||||||
|
setlocal path+=src/main/scala,src/test/scala
|
||||||
|
setlocal suffixesadd=.scala
|
||||||
|
|
||||||
set makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
set makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
||||||
set efm=%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
set efm=%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ if exists("*searchpairpos")
|
|||||||
let g:clojure_align_multiline_strings = 0
|
let g:clojure_align_multiline_strings = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:clojure_align_subforms')
|
||||||
|
let g:clojure_align_subforms = 0
|
||||||
|
endif
|
||||||
|
|
||||||
function! s:SynIdName()
|
function! s:SynIdName()
|
||||||
return synIDattr(synID(line("."), col("."), 0), "name")
|
return synIDattr(synID(line("."), col("."), 0), "name")
|
||||||
endfunction
|
endfunction
|
||||||
@@ -284,7 +288,7 @@ if exists("*searchpairpos")
|
|||||||
call search('\v\_s', 'cW')
|
call search('\v\_s', 'cW')
|
||||||
call search('\v\S', 'W')
|
call search('\v\S', 'W')
|
||||||
if paren[0] < line(".")
|
if paren[0] < line(".")
|
||||||
return paren[1] + &shiftwidth - 1
|
return paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call search('\v\S', 'bW')
|
call search('\v\S', 'bW')
|
||||||
|
|||||||
@@ -6,36 +6,5 @@
|
|||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
setlocal autoindent sw=2 et
|
|
||||||
setlocal indentexpr=GetLessIndent()
|
|
||||||
setlocal indentkeys=o,O,*<Return>,<:>,!^F
|
|
||||||
|
|
||||||
" Only define the function once.
|
|
||||||
if exists("*GetLessIndent")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)'
|
|
||||||
|
|
||||||
function! GetLessIndent()
|
|
||||||
let lnum = prevnonblank(v:lnum-1)
|
|
||||||
let line = substitute(getline(lnum),'\s\+$','','')
|
|
||||||
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
|
|
||||||
let lastcol = strlen(line)
|
|
||||||
let line = substitute(line,'^\s\+','','')
|
|
||||||
let indent = indent(lnum)
|
|
||||||
let cindent = indent(v:lnum)
|
|
||||||
if line !~ s:property && cline =~ s:property
|
|
||||||
return indent + &sw
|
|
||||||
"elseif line =~ s:property && cline !~ s:property
|
|
||||||
"return indent - &sw
|
|
||||||
else
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" vim:set sw=2:
|
|
||||||
|
|
||||||
|
|
||||||
|
runtime! indent/css.vim
|
||||||
@@ -134,6 +134,7 @@ function! GetPerlIndent()
|
|||||||
\ || synid == "perlMatchStartEnd"
|
\ || synid == "perlMatchStartEnd"
|
||||||
\ || synid == "perlHereDoc"
|
\ || synid == "perlHereDoc"
|
||||||
\ || synid == "perlBraces"
|
\ || synid == "perlBraces"
|
||||||
|
\ || synid == "perlStatementIndirObj"
|
||||||
\ || synid =~ "^perlFiledescStatement"
|
\ || synid =~ "^perlFiledescStatement"
|
||||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||||
let brace = strpart(line, bracepos, 1)
|
let brace = strpart(line, bracepos, 1)
|
||||||
@@ -151,6 +152,7 @@ function! GetPerlIndent()
|
|||||||
if synid == ""
|
if synid == ""
|
||||||
\ || synid == "perlMatchStartEnd"
|
\ || synid == "perlMatchStartEnd"
|
||||||
\ || synid == "perlBraces"
|
\ || synid == "perlBraces"
|
||||||
|
\ || synid == "perlStatementIndirObj"
|
||||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||||
let ind = ind - &sw
|
let ind = ind - &sw
|
||||||
endif
|
endif
|
||||||
|
|||||||
0
syntax/coffee.vim
Executable file → Normal file
0
syntax/coffee.vim
Executable file → Normal file
@@ -2,6 +2,7 @@
|
|||||||
" Language: Markdown
|
" Language: Markdown
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: *.markdown
|
" Filenames: *.markdown
|
||||||
|
" Last Change: 2013 May 30
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr
|
|||||||
|
|
||||||
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
|
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
|
||||||
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
|
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
|
||||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
|
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
|
||||||
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
|
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
|
||||||
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
|
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
|
||||||
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
|
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
|
||||||
@@ -94,7 +94,7 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read
|
|||||||
syn match perlStatementVector "\<vec\>"
|
syn match perlStatementVector "\<vec\>"
|
||||||
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
|
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
|
||||||
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
||||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
|
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
|
||||||
syn match perlStatementInclude "\<\%(require\|import\)\>"
|
syn match perlStatementInclude "\<\%(require\|import\)\>"
|
||||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||||
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ syn keyword rustEnumVariant Ok Err
|
|||||||
|
|
||||||
" Types and traits {{{3
|
" Types and traits {{{3
|
||||||
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
|
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
|
||||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
|
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
|
||||||
syn keyword rustTrait Bool
|
syn keyword rustTrait Bool
|
||||||
syn keyword rustTrait ToCStr
|
syn keyword rustTrait ToCStr
|
||||||
syn keyword rustTrait Char
|
syn keyword rustTrait Char
|
||||||
@@ -94,7 +94,7 @@ syn keyword rustTrait Buffer Writer Reader Seek
|
|||||||
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
|
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
|
||||||
syn keyword rustTrait Str StrVector StrSlice OwnedStr
|
syn keyword rustTrait Str StrVector StrSlice OwnedStr
|
||||||
syn keyword rustTrait IterBytes
|
syn keyword rustTrait IterBytes
|
||||||
syn keyword rustTrait ToStr ToStrConsume
|
syn keyword rustTrait ToStr IntoStr
|
||||||
syn keyword rustTrait CopyableTuple ImmutableTuple
|
syn keyword rustTrait CopyableTuple ImmutableTuple
|
||||||
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
||||||
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
||||||
|
|||||||
@@ -11,12 +11,23 @@ syn sync minlines=200 maxlines=1000
|
|||||||
|
|
||||||
syn keyword scalaKeyword catch do else final finally for forSome if
|
syn keyword scalaKeyword catch do else final finally for forSome if
|
||||||
syn keyword scalaKeyword match return throw try while yield
|
syn keyword scalaKeyword match return throw try while yield
|
||||||
syn keyword scalaKeyword class trait object extends with type nextgroup=scalaInstanceDeclaration skipwhite
|
syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite
|
||||||
syn keyword scalaKeyword case nextgroup=scalaCaseFollowing skipwhite
|
syn keyword scalaKeyword type nextgroup=scalaTypeDeclaration skipwhite
|
||||||
|
syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite
|
||||||
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
|
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
|
||||||
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
|
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
|
||||||
hi link scalaKeyword Keyword
|
hi link scalaKeyword Keyword
|
||||||
|
|
||||||
|
syn match scalaSymbol /'[_A-Za-z0-9$]\+/
|
||||||
|
hi link scalaSymbol Number
|
||||||
|
|
||||||
|
syn match scalaChar /'.'/
|
||||||
|
syn match scalaEscapedChar /\\[\\ntbrf]/
|
||||||
|
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
||||||
|
hi link scalaChar Character
|
||||||
|
hi link scalaEscapedChar Function
|
||||||
|
hi link scalaUnicodeChar Special
|
||||||
|
|
||||||
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained
|
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained
|
||||||
syn match scalaNameDefinition /`[^`]\+`/ contained
|
syn match scalaNameDefinition /`[^`]\+`/ contained
|
||||||
hi link scalaNameDefinition Function
|
hi link scalaNameDefinition Function
|
||||||
@@ -25,6 +36,19 @@ syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained
|
|||||||
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
|
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
|
||||||
hi link scalaInstanceDeclaration Special
|
hi link scalaInstanceDeclaration Special
|
||||||
|
|
||||||
|
syn match scalaTypeDeclaration /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension,scalaTypeEquals skipwhite
|
||||||
|
syn match scalaTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypePostDeclaration skipwhite
|
||||||
|
syn match scalaTypeExtension /\%(=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeDeclaration skipwhite
|
||||||
|
syn match scalaTypePostDeclaration /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypePostExtension skipwhite
|
||||||
|
syn match scalaTypePostExtension /\%(=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypePostDeclaration skipwhite
|
||||||
|
hi link scalaTypeDeclaration Type
|
||||||
|
hi link scalaTypeExtension Keyword
|
||||||
|
hi link scalaTypePostDeclaration Special
|
||||||
|
hi link scalaTypePostExtension Keyword
|
||||||
|
|
||||||
|
syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$)\s]:\_s*\)\@<=[_(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeExtension contains=scalaRoundBrackets
|
||||||
|
hi link scalaTypeAnnotation Type
|
||||||
|
|
||||||
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]*\>/ contained
|
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]*\>/ contained
|
||||||
syn match scalaCaseFollowing /`[^`]\+`/ contained
|
syn match scalaCaseFollowing /`[^`]\+`/ contained
|
||||||
hi link scalaCaseFollowing Special
|
hi link scalaCaseFollowing Special
|
||||||
@@ -38,16 +62,18 @@ syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
|||||||
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
||||||
hi link scalaSpecial PreProc
|
hi link scalaSpecial PreProc
|
||||||
|
|
||||||
syn region scalaString start=/"/ skip=/\\"/ end=/"/
|
syn match scalaStringEmbeddedQuote /\\"/ contained
|
||||||
|
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaString String
|
hi link scalaString String
|
||||||
|
hi link scalaStringEmbeddedQuote String
|
||||||
|
|
||||||
syn region scalaSString matchgroup=Special start=/s"/ skip=/\\"/ end=/"/ contains=scalaInterpolation
|
syn region scalaSString matchgroup=Special start=/s"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||||
syn match scalaInterpolation /\${[^}]\+}/ contained
|
syn match scalaInterpolation /\${[^}]\+}/ contained
|
||||||
hi link scalaSString String
|
hi link scalaSString String
|
||||||
hi link scalaInterpolation Function
|
hi link scalaInterpolation Function
|
||||||
|
|
||||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaFInterpolation
|
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+%[-A-Za-z0-9\.]\+/ contained
|
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+%[-A-Za-z0-9\.]\+/ contained
|
||||||
syn match scalaFInterpolation /\${[^}]\+}%[-A-Za-z0-9\.]\+/ contained
|
syn match scalaFInterpolation /\${[^}]\+}%[-A-Za-z0-9\.]\+/ contained
|
||||||
hi link scalaFString String
|
hi link scalaFString String
|
||||||
@@ -61,9 +87,9 @@ syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<q"""/ end=/"""/ conta
|
|||||||
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""/ contains=scalaInterpolation
|
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""/ contains=scalaInterpolation
|
||||||
hi link scalaTripleQuasiQuotes String
|
hi link scalaTripleQuasiQuotes String
|
||||||
|
|
||||||
syn region scalaTripleString start=/"""/ end=/"""/
|
syn region scalaTripleString start=/"""/ end=/"""/ contains=scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleSString matchgroup=PreProc start=/s"""/ end=/"""/
|
syn region scalaTripleSString matchgroup=Special start=/s"""/ end=/"""/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleFString matchgroup=PreProc start=/f"""/ end=/"""/
|
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaTripleString String
|
hi link scalaTripleString String
|
||||||
hi link scalaTripleSString String
|
hi link scalaTripleSString String
|
||||||
hi link scalaTripleFString String
|
hi link scalaTripleFString String
|
||||||
@@ -76,13 +102,13 @@ syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
|||||||
syn match scalaNumber "\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>"
|
syn match scalaNumber "\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||||
hi link scalaNumber Number
|
hi link scalaNumber Number
|
||||||
|
|
||||||
syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" contains=scalaSpecial,scalaTypeParameter,scalaSquareBrackets,scalaTypeOperator
|
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets
|
||||||
syn match scalaTypeAnnotation /\%(:\s*\)\@<=[_\.A-Za-z0-9$]\+/
|
|
||||||
syn match scalaTypeParameter /[_\.A-Za-z0-9$]\+/ contained
|
syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" skipwhite nextgroup=scalaTypeEquals,scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
|
||||||
syn match scalaTypeOperator /[=:<>]\+/ contained
|
syn match scalaTypeOperator /[-+=:<>]\+/ contained
|
||||||
hi link scalaTypeAnnotation Type
|
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
||||||
hi link scalaTypeParameter Type
|
hi link scalaTypeOperator Keyword
|
||||||
hi link scalaTypeOperator Type
|
hi link scalaTypeAnnotationParameter Function
|
||||||
|
|
||||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaCommentCodeBlock,@scalaHtml keepend
|
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaCommentCodeBlock,@scalaHtml keepend
|
||||||
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
||||||
|
|||||||
Reference in New Issue
Block a user