Skip to content

Commit f095d2b

Browse files
committed
Merge pull request #633 from chiphogg/highlight_updates
Add 'vundlelog' filetype + settings/highlighting
2 parents 3a35994 + 0d330db commit f095d2b

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

autoload/vundle/scripts.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func! s:view_changelog()
124124
setl buftype=nofile
125125
setl noswapfile
126126
setl ro noma
127+
setfiletype vundlelog
127128

128129
wincmd P | wincmd H
129130
endf

ftplugin/vundlelog.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
" ---------------------------------------------------------------------------
2+
" Standard ftplugin boilerplate; see ':help ftplugin'.
3+
" ---------------------------------------------------------------------------
4+
if exists("b:did_ftplugin")
5+
finish
6+
endif
7+
let b:did_ftplugin = 1
8+
9+
10+
" ---------------------------------------------------------------------------
11+
" Settings for the Vundle update log buffer.
12+
" ---------------------------------------------------------------------------
13+
setlocal textwidth=0
14+
setlocal nowrap
15+
setlocal noswapfile

syntax/vundlelog.vim

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
" ---------------------------------------------------------------------------
2+
" Syntax highlighting for the line which identifies the plugin.
3+
" ---------------------------------------------------------------------------
4+
syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$'
5+
highlight link VundlePluginName Keyword
6+
7+
" ---------------------------------------------------------------------------
8+
" Syntax highlighting for the 'compare at' line of each plugin.
9+
" ---------------------------------------------------------------------------
10+
syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n'
11+
\ contains=VundleCompareUrl
12+
syntax match VundleCompareUrl '\vhttps:\S+'
13+
highlight link VundleCompareLine Comment
14+
highlight link VundleCompareUrl Underlined
15+
16+
" ---------------------------------------------------------------------------
17+
" Syntax highlighting for individual commits.
18+
" ---------------------------------------------------------------------------
19+
" The main commit line.
20+
" Note that this regex is intimately related to the one for VundleCommitTree,
21+
" and the two should be changed in sync.
22+
syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$'
23+
\ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime
24+
highlight link VundleCommitLine String
25+
" Sub-regions inside the commit message.
26+
syntax match VundleCommitMerge '\v Merge pull request #\d+.*'
27+
syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@='
28+
syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$'
29+
highlight link VundleCommitMerge Ignore
30+
highlight link VundleCommitUser Identifier
31+
highlight link VundleCommitTime Comment
32+
" The git history DAG markers are outside of the main commit line region.
33+
" Note that this regex is intimately related to the one for VundleCommitLine,
34+
" and the two should be changed in sync.
35+
syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*'
36+
highlight link VundleCommitTree Label

0 commit comments

Comments
 (0)