Skip to content

Commit a6575b6

Browse files
committed
Merge pull request #683 from nfischer/LogHighlighting
Adding another Vundle Log filetype + settings/highlighting
2 parents b4328e2 + 58742e7 commit a6575b6

File tree

5 files changed

+86
-29
lines changed

5 files changed

+86
-29
lines changed

autoload/vundle/scripts.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func! s:view_log()
6767
setl buftype=nofile
6868
setl noswapfile
6969
setl ro noma
70+
setfiletype vundlelog
7071

7172
wincmd P | wincmd H
7273
endf
@@ -124,7 +125,7 @@ func! s:view_changelog()
124125
setl buftype=nofile
125126
setl noswapfile
126127
setl ro noma
127-
setfiletype vundlelog
128+
setfiletype vundlechangelog
128129

129130
wincmd P | wincmd H
130131
endf

ftplugin/vundlechangelog.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

ftplugin/vundlelog.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ let b:did_ftplugin = 1
88

99

1010
" ---------------------------------------------------------------------------
11-
" Settings for the Vundle update log buffer.
11+
" Settings for the Vundle log buffer.
1212
" ---------------------------------------------------------------------------
1313
setlocal textwidth=0
14-
setlocal nowrap
1514
setlocal noswapfile

syntax/vundlechangelog.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

syntax/vundlelog.vim

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
" ---------------------------------------------------------------------------
22
" Syntax highlighting for the line which identifies the plugin.
33
" ---------------------------------------------------------------------------
4-
syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$'
4+
syntax match VundlePluginName '\v\C(Plugin )@<=\S+/\S+(\s|$)'
55
highlight link VundlePluginName Keyword
66

77
" ---------------------------------------------------------------------------
8-
" Syntax highlighting for the 'compare at' line of each plugin.
8+
" Syntax highlighting for diffs on each plugin
99
" ---------------------------------------------------------------------------
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
10+
syntax match VundleGitAddition '\v(\|\s*\d+ )@<=\++'
11+
highlight VundleGitAddition guifg=darkgreen guibg=NONE gui=bold
12+
\ ctermfg=darkgreen ctermbg=NONE cterm=bold
13+
14+
syntax match VundleGitDeletion '\v(\|\s*\d+ \+*)@<=-+'
15+
highlight VundleGitDeletion guifg=red guibg=NONE gui=bold ctermfg=red
16+
\ ctermbg=NONE cterm=bold
1517

1618
" ---------------------------------------------------------------------------
17-
" Syntax highlighting for individual commits.
19+
" Syntax highlighting for log-specific features
1820
" ---------------------------------------------------------------------------
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
21+
syntax match VundleCaret '\V >'
22+
highlight link VundleCaret Label
23+
24+
" Make path to tags file stand out
25+
syntax match VundleTagPath '\v\C(:helptags )@<=/\S+$'
26+
highlight link VundleTagPath Comment
27+
28+
" Make URL stand out
29+
syntax match VundleCompareUrl '\v\Chttps:\S+'
30+
highlight link VundleCompareUrl Underlined
31+
32+
" Make errors (from git) stand out
33+
syntax match VundleError '\v\C( \> )@<=fatal:.*$'
34+
highlight link VundleError Error
35+
36+
" Make git messages stand out
37+
syntax match VundleGitMsg '\v\C( \> )@<=git:.*$'
38+
highlight link VundleGitMsg Type
39+
40+
" De-emphasize the time stamp
41+
syntax match VundleTimeStamp '\m^\[\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}]'
42+
highlight link VundleTimeStamp String

0 commit comments

Comments
 (0)