dotfiles

<-- duh.
git clone https://hhvn.uk/dotfiles
git clone git://hhvn.uk/dotfiles
Log | Files | Refs | Submodules | LICENSE

magit.vim (2231B)


      1 if exists("b:current_syntax")
      2   finish
      3 endif
      4 
      5 let s:vimagit_path = fnameescape(resolve(expand('<sfile>:p:h')))
      6 execute 'source ' . s:vimagit_path . '/../common/magit_common.vim'
      7 
      8 syn case match
      9 syn sync minlines=50
     10 
     11 syn include @diff syntax/diff.vim
     12 
     13 execute 'syn match titleEntry "' . g:magit_section_re . '\n\%(.*\n\)\{-}=\+"'
     14 hi def link titleEntry Comment
     15 
     16 execute 'syn region commitMsg start=/' . g:magit_sections.commit . '/ end=/\%(' . g:magit_section_re . '\)\@=/ contains=titleEntry'
     17 execute 'syn match commitMsgExceed "\%(=\+\n\+\_^.\{' . g:magit_commit_title_limit . '}\)\@<=.*$" contained containedin=commitMsg'
     18 hi def link commitMsgExceed Comment
     19 
     20 execute 'syn match stashEntry "' . g:magit_stash_re . '"'
     21 hi def link stashEntry String
     22 
     23 execute 'syn match fileEntry "' . g:magit_file_re . '"'
     24 hi def link fileEntry String
     25 
     26 execute 'syn region gitStash start=/' . g:magit_stash_re . '/ end=/\%(' .
     27  \ g:magit_stash_re . '\)\@=/ contains=stashEntry fold'
     28 
     29 execute 'syn region gitFile start=/' . g:magit_file_re . '/ end=/\%(' .
     30 			\ g:magit_end_diff_re . '\)\@=/ contains=gitHunk,fileEntry fold'
     31 
     32 execute 'syn region gitHunk start=/' .
     33  \ g:magit_hunk_re . '/ end=/\%(' . g:magit_end_diff_re . '\|' . g:magit_hunk_re 
     34  \ '\)\@=/ contains=@diff fold'
     35 
     36 execute 'syn match gitInfoRepo   "\%(' . g:magit_section_info.cur_repo . '\)\@<=.*$" oneline'
     37 execute 'syn match gitInfoHead "\%(' . g:magit_section_info.cur_head . '\s*\)\@<=\S\+" oneline'
     38 execute 'syn match gitInfoUpstream "\%(' . g:magit_section_info.cur_upstream . '\s*\)\@<=\S\+" oneline'
     39 execute 'syn match gitInfoPush "\%(' . g:magit_section_info.cur_push . '\s*\)\@<=\S\+" oneline'
     40 execute 'syn match gitCommitMode "\%(' . g:magit_section_info.commit_mode . '\)\@<=.*$" oneline'
     41 "execute 'syn match gitInfoCommit "\%(' . g:magit_section_info.cur_commit . '\)\@<=.*$" contains=infoSha1 oneline'
     42 "syntax match infoSha1 containedin=gitInfoCommit "\x\{7,}"
     43 
     44 highlight default link gitInfoRepo Directory
     45 highlight default link gitInfoHead Identifier
     46 highlight default link gitInfoUpstream Identifier
     47 highlight default link gitInfoPush Identifier
     48 highlight default link gitCommitMode Special
     49 highlight default link infoSha1 Identifier
     50 
     51 let b:current_syntax = "magit"