# HG changeset patch # User Ludovic Chabant # Date 1323500933 28800 # Node ID adc267e2f0f4d89627e804de2cadb1c0cd84f001 # Parent 1da613c13d81df163410d36de43f92f17e20d1b2 Added syntax highlighting for hgstatus window. diff -r 1da613c13d81 -r adc267e2f0f4 ftdetect/hgcommit.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftdetect/hgcommit.vim Fri Dec 09 23:08:53 2011 -0800 @@ -0,0 +1,2 @@ +au BufRead,BufNewFile hg-editor-*.txt set filetype=hgcommit + diff -r 1da613c13d81 -r adc267e2f0f4 ftdetect/hgstatus.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftdetect/hgstatus.vim Fri Dec 09 23:08:53 2011 -0800 @@ -0,0 +1,2 @@ +au BufRead,BufNewFile hg-status-*.txt set filetype=hgstatus + diff -r 1da613c13d81 -r adc267e2f0f4 plugin/lawrencium.vim --- a/plugin/lawrencium.vim Fri Dec 09 17:12:13 2011 -0800 +++ b/plugin/lawrencium.vim Fri Dec 09 23:08:53 2011 -0800 @@ -248,12 +248,14 @@ call append(0, l:status_lines) execute "setlocal previewheight=" . l:preview_height - " Setup the buffer correctly. + " Setup the buffer correctly: readonly, and with the correct repo linked + " to it. let b:mercurial_dir = l:repo.root_dir setlocal buftype=nofile setlocal nomodified setlocal nomodifiable setlocal readonly + setlocal syntax=hgstatus " Add some handy mappings. nnoremap :call search('^[MARC\!\?I ]\s.', 'We') diff -r 1da613c13d81 -r adc267e2f0f4 syntax/hgcommit.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntax/hgcommit.vim Fri Dec 09 23:08:53 2011 -0800 @@ -0,0 +1,46 @@ +" Vim syntax file +" Language: hg commit file +" Maintainer: Pierre Bourdon +" Filenames: ^hg-editor-*.txt +" Last Change: 2010 Jun 13 + +" Some parts of the code by Dan LaMotte + +if exists("b:current_syntax") + finish +endif + +syn case match +syn sync minlines=50 + +if has("spell") + syn spell toplevel +endif + +syn match hgcommitFirstline "\%^.*" nextgroup=hgcommitBlank skipnl +syn match hgcommitSummary "^.\{0,78\}" contained containedin=hgcommitFirstline nextgroup=hgcommitOverflow contains=@Spell +syn match hgcommitOverflow ".*" contained contains=@Spell +syn match hgcommitBlank "^HG:\@!.*" contained contains=@Spell + +syn match hgcommitComment "^HG:.*" + +syn match hgcommitOnBranch "\%(^HG: \)\@<=\ '" contained containedin=hgcommitComment nextgroup=hgcommitBranch +syn match hgcommitBranch "[^']\+" contained +syn match hgcommitAdded "\%(^HG: \)\@<=\" contained containedin=hgcommitComment nextgroup=hgcommitFile +syn match hgcommitChanged "\%(^HG: \)\@<=\" contained containedin=hgcommitComment nextgroup=hgcommitFile +syn match hgcommitRemoved "\%(^HG: \)\@<=\" contained containedin=hgcommitComment nextgroup=hgcommitFile +syn match hgcommitFile " \S\+" contained containedin=hgcommitAdded,hgcommitChanged + +hi def link hgcommitSummary Keyword +hi def link hgcommitOverflow Error +hi def link hgcommitBlank Error + +hi def link hgcommitComment Comment +hi def link hgcommitOnBranch Comment +hi def link hgcommitBranch Special +hi def link hgcommitOnBranchEnd Comment +hi def link hgcommitAdded Type +hi def link hgcommitChanged Type +hi def link hgcommitRemoved Type +hi def link hgcommitFile Constant + diff -r 1da613c13d81 -r adc267e2f0f4 syntax/hgstatus.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntax/hgstatus.vim Fri Dec 09 23:08:53 2011 -0800 @@ -0,0 +1,28 @@ +" Vim syntax file +" Language: hg status output +" Maintainer: Ludovic Chabant +" Filenames: ^hg-status-*.txt + +if exists("b:current_syntax") + finish +endif + +syn case match + +syn match hgstatusModified "^M\s.*" +syn match hgstatusAdded "^A\s.*" +syn match hgstatusRemoved "^R\s.*" +syn match hgstatusClean "^C\s.*" +syn match hgstatusMissing "^?\s.*" +syn match hgstatusNotTracked "^!\s.*" +syn match hgstatusIgnored "^I\s.*" + +hi def link hgstatusModified Identifier +hi def link hgstatusAdded Statement +hi def link hgstatusRemoved PreProc +hi def link hgstatusClean Constant +hi def link hgstatusMissing Error +hi def link hgstatusNotTracked Todo +hi def link hgstatusIgnored Ignore +hi def link hgstatusFileName Constant +