mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.
This commit is contained in:
@ -10,12 +10,10 @@ endif
|
||||
|
||||
" Include JavaScript for coffeeEmbed.
|
||||
syn include @coffeeJS syntax/javascript.vim
|
||||
silent! unlet b:current_syntax
|
||||
|
||||
" Highlight long strings.
|
||||
syn sync minlines=100
|
||||
|
||||
" CoffeeScript identifiers can have dollar signs.
|
||||
setlocal isident+=$
|
||||
syntax sync fromstart
|
||||
|
||||
" These are `matches` instead of `keywords` because vim's highlighting
|
||||
" priority for keywords is higher than matches. This causes keywords to be
|
||||
@ -66,7 +64,7 @@ syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display
|
||||
hi def link coffeeSpecialVar Special
|
||||
|
||||
" An @-variable
|
||||
syn match coffeeSpecialIdent /@\%(\I\i*\)\?/ display
|
||||
syn match coffeeSpecialIdent /@\%(\%(\I\|\$\)\%(\i\|\$\)*\)\?/ display
|
||||
hi def link coffeeSpecialIdent Identifier
|
||||
|
||||
" A class-like name that starts with a capital letter
|
||||
@ -94,27 +92,27 @@ syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/
|
||||
hi def link coffeeString String
|
||||
|
||||
" A integer, including a leading plus or minus
|
||||
syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
|
||||
syn match coffeeNumber /\%(\i\|\$\)\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
|
||||
" A hex, binary, or octal number
|
||||
syn match coffeeNumber /\<0[xX]\x\+\>/ display
|
||||
syn match coffeeNumber /\<0[bB][01]\+\>/ display
|
||||
syn match coffeeNumber /\<0[oO][0-7]\+\>/ display
|
||||
syn match coffeeNumber /\<\%(Infinity\|NaN\)\>/ display
|
||||
hi def link coffeeNumber Number
|
||||
|
||||
" A floating-point number, including a leading plus or minus
|
||||
syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
|
||||
syn match coffeeFloat /\%(\i\|\$\)\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
|
||||
\ display
|
||||
hi def link coffeeFloat Float
|
||||
|
||||
" An error for reserved keywords
|
||||
if !exists("coffee_no_reserved_words_error")
|
||||
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|let\|package\|private\|protected\|public\|static\|yield\)\>/
|
||||
\ display
|
||||
hi def link coffeeReservedError Error
|
||||
endif
|
||||
" An error for reserved keywords, taken from the RESERVED array:
|
||||
" http://coffeescript.org/documentation/docs/lexer.html#section-67
|
||||
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\|yield\)\>/
|
||||
\ display
|
||||
hi def link coffeeReservedError Error
|
||||
|
||||
" A normal object assignment
|
||||
syn match coffeeObjAssign /@\?\I\i*\s*\ze::\@!/ contains=@coffeeIdentifier display
|
||||
syn match coffeeObjAssign /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@coffeeIdentifier display
|
||||
hi def link coffeeObjAssign Identifier
|
||||
|
||||
syn keyword coffeeTodo TODO FIXME XXX contained
|
||||
@ -134,7 +132,7 @@ hi def link coffeeHeregexComment coffeeComment
|
||||
|
||||
" Embedded JavaScript
|
||||
syn region coffeeEmbed matchgroup=coffeeEmbedDelim
|
||||
\ start=/`/ skip=/\\\\\|\\`/ end=/`/
|
||||
\ start=/`/ skip=/\\\\\|\\`/ end=/`/ keepend
|
||||
\ contains=@coffeeJS
|
||||
hi def link coffeeEmbedDelim Delimiter
|
||||
|
||||
@ -148,17 +146,23 @@ hi def link coffeeEscape SpecialChar
|
||||
|
||||
" A regex -- must not follow a parenthesis, number, or identifier, and must not
|
||||
" be followed by a number
|
||||
syn region coffeeRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/=\@!\s\@!/
|
||||
\ skip=/\[[^\]]\{-}\/[^\]]\{-}\]/
|
||||
\ end=/\/[gimy]\{,4}\d\@!/
|
||||
\ oneline contains=@coffeeBasicString
|
||||
syn region coffeeRegex start=#\%(\%()\|\%(\i\|\$\)\@<!\d\)\s*\|\i\)\@<!/=\@!\s\@!#
|
||||
\ end=#/[gimy]\{,4}\d\@!#
|
||||
\ oneline contains=@coffeeBasicString,coffeeRegexCharSet
|
||||
syn region coffeeRegexCharSet start=/\[/ end=/]/ contained
|
||||
\ contains=@coffeeBasicString
|
||||
hi def link coffeeRegex String
|
||||
hi def link coffeeRegexCharSet coffeeRegex
|
||||
|
||||
" A heregex
|
||||
syn region coffeeHeregex start=/\/\/\// end=/\/\/\/[gimy]\{,4}/
|
||||
\ contains=@coffeeInterpString,coffeeHeregexComment
|
||||
syn region coffeeHeregex start=#///# end=#///[gimy]\{,4}#
|
||||
\ contains=@coffeeInterpString,coffeeHeregexComment,
|
||||
\ coffeeHeregexCharSet
|
||||
\ fold
|
||||
syn region coffeeHeregexCharSet start=/\[/ end=/]/ contained
|
||||
\ contains=@coffeeInterpString
|
||||
hi def link coffeeHeregex coffeeRegex
|
||||
hi def link coffeeHeregexCharSet coffeeHeregex
|
||||
|
||||
" Heredoc strings
|
||||
syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString
|
||||
@ -168,23 +172,19 @@ syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString
|
||||
hi def link coffeeHeredoc String
|
||||
|
||||
" An error for trailing whitespace, as long as the line isn't just whitespace
|
||||
if !exists("coffee_no_trailing_space_error")
|
||||
syn match coffeeSpaceError /\S\@<=\s\+$/ display
|
||||
hi def link coffeeSpaceError Error
|
||||
endif
|
||||
syn match coffeeSpaceError /\S\@<=\s\+$/ display
|
||||
hi def link coffeeSpaceError Error
|
||||
|
||||
" An error for trailing semicolons, for help transitioning from JavaScript
|
||||
if !exists("coffee_no_trailing_semicolon_error")
|
||||
syn match coffeeSemicolonError /;$/ display
|
||||
hi def link coffeeSemicolonError Error
|
||||
endif
|
||||
syn match coffeeSemicolonError /;$/ display
|
||||
hi def link coffeeSemicolonError Error
|
||||
|
||||
" Ignore reserved words in dot accesses.
|
||||
syn match coffeeDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@coffeeIdentifier
|
||||
syn match coffeeDotAccess /\.\@<!\.\s*\%(\I\|\$\)\%(\i\|\$\)*/he=s+1 contains=@coffeeIdentifier
|
||||
hi def link coffeeDotAccess coffeeExtendedOp
|
||||
|
||||
" Ignore reserved words in prototype accesses.
|
||||
syn match coffeeProtoAccess /::\s*\I\i*/he=s+2 contains=@coffeeIdentifier
|
||||
syn match coffeeProtoAccess /::\s*\%(\I\|\$\)\%(\i\|\$\)*/he=s+2 contains=@coffeeIdentifier
|
||||
hi def link coffeeProtoAccess coffeeExtendedOp
|
||||
|
||||
" This is required for interpolations to work.
|
||||
|
@ -1,62 +0,0 @@
|
||||
" Vim syntax file
|
||||
" Language: eco
|
||||
" Maintainer: Jay Adkisson
|
||||
" Mostly stolen from eruby.vim
|
||||
|
||||
if !exists("g:eco_default_subtype")
|
||||
let g:eco_default_subtype = "html"
|
||||
endif
|
||||
|
||||
if !exists("b:eco_subtype")
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eco_subtype = matchstr(s:lines,'eco_subtype=\zs\w\+')
|
||||
if b:eco_subtype == ''
|
||||
let b:eco_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eco\)\+$','',''),'\.\zs\w\+$')
|
||||
endif
|
||||
if b:eco_subtype == 'rhtml'
|
||||
let b:eco_subtype = 'html'
|
||||
elseif b:eco_subtype == 'jst'
|
||||
let b:eco_subtype = 'html'
|
||||
elseif b:eco_subtype == 'rb'
|
||||
let b:eco_subtype = 'ruby'
|
||||
elseif b:eco_subtype == 'yml'
|
||||
let b:eco_subtype = 'yaml'
|
||||
elseif b:eco_subtype == 'js' || b:eco_subtype == 'json'
|
||||
let b:eco_subtype = 'javascript'
|
||||
elseif b:eco_subtype == 'txt'
|
||||
" Conventional; not a real file type
|
||||
let b:eco_subtype = 'text'
|
||||
elseif b:eco_subtype == ''
|
||||
if exists('b:current_syntax') && b:current_syntax != ''
|
||||
let b:eco_subtype = b:current_syntax
|
||||
else
|
||||
let b:eco_subtype = g:eco_default_subtype
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists("b:eco_subtype") && b:eco_subtype != '' && b:eco_subtype != 'eco'
|
||||
exec "runtime! syntax/".b:eco_subtype.".vim"
|
||||
syn include @coffeeTop syntax/coffee.vim
|
||||
endif
|
||||
|
||||
syn cluster ecoRegions contains=ecoBlock,ecoExpression,ecoComment
|
||||
|
||||
syn region ecoBlock matchgroup=ecoDelimiter start=/<%/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
|
||||
syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
|
||||
syn region ecoComment matchgroup=ecoComment start=/<%#/ end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend
|
||||
|
||||
" eco features not in coffeescript proper
|
||||
syn keyword ecoEnd end containedin=@ecoRegions
|
||||
syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions
|
||||
|
||||
" Define the default highlighting.
|
||||
|
||||
hi def link ecoDelimiter Delimiter
|
||||
hi def link ecoComment Comment
|
||||
hi def link ecoEnd coffeeConditional
|
||||
hi def link ecoIndentColon None
|
||||
|
||||
let b:current_syntax = 'eco'
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8:
|
Reference in New Issue
Block a user