Skip to content
Snippets Groups Projects
Select Git revision
  • 19adac1d218b9c11dcc22f7b6e91880d41c0a56a
  • master default protected
  • amend_commit
  • next
  • dev/nomodifiable
  • dev/discard_vselect
  • dev/catch_shell_error
  • dev/mapping_2
  • dev/close
  • dev/issue_123
  • dev/issue_71
  • dev/mapping
  • dev/remove_end_commit
  • dev/stash
  • dev/test_commit
  • dev/save_commmit_msg
  • dev/push
  • dev/git_diff
  • dev/undo
  • gh-pages
  • dev/display
  • 1.8.0
  • 1.7.3
  • 1.7.2
  • 1.7.1
  • 1.7.0
  • 1.6.0
  • 1.5.2
  • 1.5.1
  • 1.5.0
  • 1.4.2
  • 1.4.1
  • 1.4
  • 1.3
  • 1.2
  • 1.0
  • 1.1
37 results

magit.vim

Blame
  • magit.vim 1.86 KiB
    if exists("b:current_syntax")
      finish
    endif
    
    let s:vimagit_path = fnameescape(resolve(expand('<sfile>:p:h')))
    execute 'source ' . s:vimagit_path . '/../common/magit_common.vim'
    
    syn case match
    syn sync minlines=50
    
    syn include @diff syntax/diff.vim
    
    execute 'syn match titleEntry "' . g:magit_section_re . '\n=\+"'
    hi def link titleEntry Comment
    
    execute 'syn match stashEntry "' . g:magit_stash_re . '"'
    hi def link stashEntry String
    
    execute 'syn match fileEntry "' . g:magit_file_re . '"'
    hi def link fileEntry String
    
    execute 'syn region gitTitle start=/^$\n' . g:magit_section_re . '/ end=/^$/ contains=titleEntry'
    
    execute 'syn region gitStash start=/' . g:magit_stash_re . '/ end=/\%(' .
     \ g:magit_stash_re . '\)\@=/ contains=stashEntry fold'
    
    execute 'syn region gitFile start=/' . g:magit_file_re . '/ end=/\%(' .
    			\ g:magit_end_diff_re . '\)\@=/ contains=gitHunk,fileEntry fold'
    
    execute 'syn region gitHunk start=/' .
     \ g:magit_hunk_re . '/ end=/\%(' . g:magit_end_diff_re . '\|' . g:magit_hunk_re 
     \ '\)\@=/ contains=@diff fold'
    
    execute 'syn region gitInfo start=/^' . g:magit_sections.info . '$/ end=/' .
     \ g:magit_section_re . '/'
    
    execute 'syn region gitInfoRepo start=/^' . g:magit_section_info.cur_repo .
     \ ':\s*.*/hs=s+20 end=/$/ oneline'
    highlight default link gitInfoRepo Directory
    execute 'syn region gitInfoBranch start=/^' . g:magit_section_info.cur_branch .
     \ ':\s*.*/hs=s+20 end=/$/ oneline'
    highlight default link gitInfoBranch Identifier
    execute 'syn region gitCommitMode start=/^' . g:magit_section_info.commit_mode .
     \ ':\s*.*/hs=s+20 end=/$/ oneline'
    highlight default link gitCommitMode Special
    
    execute 'syn region gitInfoCommit start=/^' . g:magit_section_info.cur_commit .
     \ ':\s*\(.*\)/ end=/$/ contains=infoSha1 oneline'
    syntax match infoSha1 containedin=gitInfoCommit "\x\{7}"
    highlight default link infoSha1 Identifier
    
    
    let b:current_syntax = "magit"