Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Mar 9, 2015
1 parent 1c21231 commit 23913e0
Show file tree
Hide file tree
Showing 24 changed files with 962 additions and 1,168 deletions.
2 changes: 1 addition & 1 deletion after/syntax/css.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('css', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
call css_color#init('css', 'extended', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
2 changes: 1 addition & 1 deletion after/syntax/less.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if !( has('gui_running') || &t_Co==256 ) | finish | endif
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/vim-less

call css_color#init('css', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
call css_color#init('css', 'extended', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
6 changes: 6 additions & 0 deletions after/syntax/lua.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <[email protected]>

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('hex', 'extended', 'luaComment,luaString')
6 changes: 6 additions & 0 deletions after/syntax/moon.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <[email protected]>

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('hex', 'extended', 'moonComment,moonString')
2 changes: 1 addition & 1 deletion after/syntax/sass.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('css', 'sassCssAttribute,sassComment,sassCssComment')
call css_color#init('css', 'extended', 'sassCssAttribute,sassComment,sassCssComment')
2 changes: 1 addition & 1 deletion after/syntax/scss.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('css', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
call css_color#init('css', 'extended', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
2 changes: 1 addition & 1 deletion after/syntax/stylus.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('css', 'stylusCssAttribute,stylusComment,cssComment')
call css_color#init('css', 'extended', 'stylusCssAttribute,stylusComment,cssComment')
2 changes: 1 addition & 1 deletion after/syntax/vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

if !( has('gui_running') || &t_Co==256 ) | finish | endif

call css_color#init('any', 'vimHiGuiRgb,vimComment,vimLineComment')
call css_color#init('hex', 'none', 'vimHiGuiRgb,vimComment,vimLineComment')
79 changes: 43 additions & 36 deletions autoload/css_color.vim
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ function! s:parse_css_screen()
call s:clear_matches()
call s:create_matches()
endfunction
function! s:parse_any_screen()
function! s:parse_hex_screen()
call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' )
call s:clear_matches()
call s:create_matches()
endfunction

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

function! css_color#init(type, groups)
function! css_color#init(type, keywords, groups)
exe 'syn cluster colorableGroup contains=' . a:groups

let b:has_color_hi = {}
Expand All @@ -273,23 +273,58 @@ function! css_color#init(type, groups)

exe 'call s:parse_'.a:type.'_screen()'

if a:type != 'css' | return | endif
if a:keywords == 'none' | return | endif

syn case ignore

" W3C basic colors

hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=231
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=235 ctermfg=231
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16

syn keyword BG000000 black contained containedin=@colorableGroup
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
syn keyword BG808080 gray contained containedin=@colorableGroup
syn match BGffffff "\c\<white\(-\)\@!\>" contained containedin=@colorableGroup
syn keyword BG800000 maroon contained containedin=@colorableGroup
syn keyword BGff0000 red contained containedin=@colorableGroup
syn keyword BG800080 purple contained containedin=@colorableGroup
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
syn keyword BG008000 green contained containedin=@colorableGroup
syn keyword BG00ff00 lime contained containedin=@colorableGroup
syn keyword BG808000 olive contained containedin=@colorableGroup
syn keyword BGffff00 yellow contained containedin=@colorableGroup
syn keyword BG000080 navy contained containedin=@colorableGroup
syn keyword BG0000ff blue contained containedin=@colorableGroup
syn keyword BG008080 teal contained containedin=@colorableGroup
syn keyword BG00ffff aqua contained containedin=@colorableGroup

if a:keywords == 'basic' | return | endif

" W3C extended colors

hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=4 ctermfg=231
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=4 ctermfg=231
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=235 ctermfg=231
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=231
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=6 ctermfg=16
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=16
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=6 ctermfg=16
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=6 ctermfg=16
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=237 ctermfg=231
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=12 ctermfg=16
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=16
Expand Down Expand Up @@ -317,10 +352,6 @@ function! css_color#init(type, groups)
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=3 ctermfg=16
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=3 ctermfg=16
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=16
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=16
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=16
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=12 ctermfg=231
Expand All @@ -347,7 +378,6 @@ function! css_color#init(type, groups)
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=5 ctermfg=16
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=16
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=247 ctermfg=16
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=5 ctermfg=231
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=16
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=173 ctermfg=16
Expand Down Expand Up @@ -383,8 +413,6 @@ function! css_color#init(type, groups)
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=16
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=255 ctermfg=16
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=16
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=5 ctermfg=231
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=9 ctermfg=231
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=16
Expand All @@ -409,30 +437,9 @@ function! css_color#init(type, groups)
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=255 ctermfg=16
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=15 ctermfg=16
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=15 ctermfg=16
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=255 ctermfg=16
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16

" W3C Colors
syn keyword BG000000 black contained containedin=@colorableGroup
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
syn keyword BG808080 gray contained containedin=@colorableGroup
syn match BGffffff "\<white\(-\)\@!\>" contained containedin=@colorableGroup
syn keyword BG800000 maroon contained containedin=@colorableGroup
syn keyword BGff0000 red contained containedin=@colorableGroup
syn keyword BG800080 purple contained containedin=@colorableGroup
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
syn keyword BG008000 green contained containedin=@colorableGroup
syn keyword BG00ff00 lime contained containedin=@colorableGroup
syn keyword BG808000 olive contained containedin=@colorableGroup
syn keyword BGffff00 yellow contained containedin=@colorableGroup
syn keyword BG000080 navy contained containedin=@colorableGroup
syn keyword BG0000ff blue contained containedin=@colorableGroup
syn keyword BG008080 teal contained containedin=@colorableGroup
syn keyword BG00ffff aqua contained containedin=@colorableGroup

" extra colors
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
Expand Down
12 changes: 10 additions & 2 deletions autoload/xml/html5.vim
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ let g:xmldata_html5 = {
\ ],
\ 'iframe': [
\ [],
\ extend(copy(global_attributes), {'src': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
\ ],
\ 'img': [
\ [],
Expand Down Expand Up @@ -659,6 +659,10 @@ let g:xmldata_html5 = {
\ phrasing_elements,
\ extend(copy(global_attributes), {'cite': []})
\ ],
\ 'rb': [
\ phrasing_elements,
\ global_attributes
\ ],
\ 'rp': [
\ phrasing_elements,
\ global_attributes
Expand All @@ -667,10 +671,14 @@ let g:xmldata_html5 = {
\ phrasing_elements,
\ global_attributes
\ ],
\ 'ruby': [
\ 'rtc': [
\ phrasing_elements + ['rp', 'rt'],
\ global_attributes
\ ],
\ 'ruby': [
\ phrasing_elements + ['rb', 'rp', 'rt', 'rtc'],
\ global_attributes
\ ],
\ 'samp': [
\ phrasing_elements,
\ global_attributes
Expand Down
4 changes: 2 additions & 2 deletions ftdetect/polyglot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function! s:DetectPerl6()
endwhile
endfunction
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
autocmd BufNew,BufRead *.nqp setf perl6
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
autocmd BufNewFile,BufRead *.proto setfiletype proto
au BufNewFile,BufRead *.ps1 set ft=ps1
au BufNewFile,BufRead *.psd1 set ft=ps1
Expand Down Expand Up @@ -180,7 +180,7 @@ au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
au BufRead,BufNewFile *.rs set filetype=rust
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
fun! s:DetectScala()
if getline(1) == '#!/usr/bin/env scala'
if getline(1) =~# '^#!\(/usr\)\?/bin/env\s\+scalas\?'
set filetype=scala
endif
endfun
Expand Down
4 changes: 2 additions & 2 deletions ftplugin/latex-box/motion.vim
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
if len(tree) > 3 && empty(tree[1])
call remove(tree, 1)
endif
if len(tree) > 1 && type(tree[0]) == type("") && tree[0] =~ '^\\\(numberline\|tocsection\)'
if len(tree) > 1 && type(tree[0]) == type("") && tree[0] =~ '^\\\(\(chapter\)\?numberline\|tocsection\)'
let secnum = LatexBox_TreeToTex(tree[1])
let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
Expand All @@ -359,7 +359,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
" parse section title
let text = LatexBox_TreeToTex(tree)
let text = substitute(text, '^{\+\|}\+$', '', 'g')
let text = substitute(text, '\m^\\\(no\)\?numberline\s*', '', '')
let text = substitute(text, '\m^\\\(no\)\?\(chapter\)\?numberline\s*', '', '')
let text = substitute(text, '\*', '', 'g')

" add TOC entry
Expand Down
2 changes: 1 addition & 1 deletion ftplugin/perl6.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ setlocal define=[^A-Za-z_]
" after/ftplugin/perl6.vim file that contains
" set isfname-=:
set isfname+=:
setlocal iskeyword=48-57,_,A-Z,a-z,:,-
setlocal iskeyword=@,48-57,_,192-255,:,-,'

" Set this once, globally.
if !exists("perlpath")
Expand Down
2 changes: 1 addition & 1 deletion ftplugin/ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if exists("loaded_matchit") && !exists("b:match_words")
\ ':' .
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ ':' .
\ '\<end\>' .
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
\ ',{:},\[:\],(:)'

let b:match_skip =
Expand Down
80 changes: 46 additions & 34 deletions indent/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
" - general line splits (line ends in an operator)

if exists("b:did_indent")
finish
finish
endif
let b:did_indent = 1

Expand All @@ -21,46 +21,58 @@ setlocal indentexpr=GoIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=)

if exists("*GoIndent")
finish
finish
endif

" use shiftwidth function only if it's available
if exists('*shiftwidth')
func s:sw()
return shiftwidth()
endfunc
else
func s:sw()
return &sw
endfunc
endif

function! GoIndent(lnum)
let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0
" top of file
return 0
endif
let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0
" top of file
return 0
endif

" grab the previous and current line, stripping comments.
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
let previ = indent(prevlnum)
" grab the previous and current line, stripping comments.
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
let previ = indent(prevlnum)

let ind = previ
let s:shiftwidth = shiftwidth()
let ind = previ

if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += s:shiftwidth
endif
if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += s:shiftwidth
endif
" TODO: handle if the previous line is a label.
if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += s:sw()
endif
if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += s:sw()
endif
" TODO: handle if the previous line is a label.

if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= s:shiftwidth
endif
if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= s:sw()
endif

" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= s:shiftwidth
endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= s:sw()
endif

return ind
return ind
endfunction

" vim:ts=4:sw=4:et
2 changes: 2 additions & 0 deletions indent/html.vim
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ call add(s:tags, 'nav')
call add(s:tags, 'output')
call add(s:tags, 'progress')
call add(s:tags, 'picture')
call add(s:tags, 'rb')
call add(s:tags, 'rp')
call add(s:tags, 'rt')
call add(s:tags, 'rtc')
call add(s:tags, 'ruby')
call add(s:tags, 'section')
call add(s:tags, 'source')
Expand Down
Loading

0 comments on commit 23913e0

Please sign in to comment.