From e91f828d24dd5578182e837cb499a749c26c5253 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Thu, 6 Aug 2015 14:53:04 -0400 Subject: [PATCH] Add 'vundlelog' filetype + settings/highlighting --- autoload/vundle/scripts.vim | 1 + ftplugin/vundlelog.vim | 15 +++++++++++++++ syntax/vundlelog.vim | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 ftplugin/vundlelog.vim create mode 100644 syntax/vundlelog.vim diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 5d564760..831adead 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -116,6 +116,7 @@ func! s:view_changelog() endif call writefile(s:create_changelog(), s:changelog_file) execute 'silent pedit' s:changelog_file + setfiletype vundlelog wincmd P | wincmd H endf diff --git a/ftplugin/vundlelog.vim b/ftplugin/vundlelog.vim new file mode 100644 index 00000000..0f338eb8 --- /dev/null +++ b/ftplugin/vundlelog.vim @@ -0,0 +1,15 @@ +" --------------------------------------------------------------------------- +" Standard ftplugin boilerplate; see ':help ftplugin'. +" --------------------------------------------------------------------------- +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + + +" --------------------------------------------------------------------------- +" Settings for the Vundle update log buffer. +" --------------------------------------------------------------------------- +setlocal textwidth=0 +setlocal nowrap +setlocal noswapfile diff --git a/syntax/vundlelog.vim b/syntax/vundlelog.vim new file mode 100644 index 00000000..5e13d8d6 --- /dev/null +++ b/syntax/vundlelog.vim @@ -0,0 +1,36 @@ +" --------------------------------------------------------------------------- +" Syntax highlighting for the line which identifies the plugin. +" --------------------------------------------------------------------------- +syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$' +highlight link VundlePluginName Keyword + +" --------------------------------------------------------------------------- +" Syntax highlighting for the 'compare at' line of each plugin. +" --------------------------------------------------------------------------- +syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n' + \ contains=VundleCompareUrl +syntax match VundleCompareUrl '\vhttps:\S+' +highlight link VundleCompareLine Comment +highlight link VundleCompareUrl Underlined + +" --------------------------------------------------------------------------- +" Syntax highlighting for individual commits. +" --------------------------------------------------------------------------- +" The main commit line. +" Note that this regex is intimately related to the one for VundleCommitTree, +" and the two should be changed in sync. +syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$' + \ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime +highlight link VundleCommitLine String +" Sub-regions inside the commit message. +syntax match VundleCommitMerge '\v Merge pull request #\d+.*' +syntax match VundleCommitUser '\v( )@<=\w+( \w+)*(, \d+ \w+ ago$)@=' +syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$' +highlight link VundleCommitMerge Ignore +highlight link VundleCommitUser Identifier +highlight link VundleCommitTime Comment +" The git history DAG markers are outside of the main commit line region. +" Note that this regex is intimately related to the one for VundleCommitLine, +" and the two should be changed in sync. +syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*' +highlight link VundleCommitTree Label