From 967b342b23f421d4d467b647d605f2c1577d4d04 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sat, 10 Feb 2018 22:04:37 +0100 Subject: [PATCH] Formatting --- plugin/vimwiki.vim | 5 ++++- syntax/vimwiki.vim | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index 0c25daf..c48a9aa 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -83,6 +83,9 @@ function! s:setup_buffer_enter() "{{{ return endif + " 'autowriteall' is a global Vim option, so in order to change it only for + " Vimwiki buffers, we need to set it here (when the cursor enters the buffer) + " and reset it when the cursor leaves the buffer let s:vimwiki_autowriteall_saved = &autowriteall let &autowriteall = vimwiki#vars#get_global('autowriteall') @@ -166,7 +169,7 @@ endfunction " }}} " Initialization of Vimwiki starts here. Make sure everything below does not -" cause autoload/base to be loaded +" cause autoload/vimwiki/base.vim to be loaded call vimwiki#vars#init() diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 0981aee..44c07fe 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -3,7 +3,7 @@ " Home: https://github.com/vimwiki/vimwiki/ " Quit if syntax file is already loaded -if version < 600 +if v:version < 600 syntax clear elseif exists("b:current_syntax") finish @@ -132,10 +132,12 @@ call s:add_target_syntax_ON(s:target, 'VimwikiLink') " Header levels, 1-6 for s:i in range(1,6) - - execute 'syntax match VimwikiHeader'.s:i.' /'.vimwiki#vars#get_syntaxlocal('rxH'.s:i, s:current_syntax).'/ contains=VimwikiTodo,VimwikiHeaderChar,VimwikiNoExistsLink,VimwikiCode,VimwikiLink,@Spell' - execute 'syntax region VimwikiH'.s:i.'Folding start=/'.vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_Start', s:current_syntax). - \ '/ end=/'.vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_End', s:current_syntax).'/me=s-1 transparent fold' + execute 'syntax match VimwikiHeader'.s:i + \ . ' /'.vimwiki#vars#get_syntaxlocal('rxH'.s:i, s:current_syntax).'/' + \ . ' contains=VimwikiTodo,VimwikiHeaderChar,VimwikiNoExistsLink,VimwikiCode,VimwikiLink,@Spell' + execute 'syntax region VimwikiH'.s:i.'Folding' + \ . ' start=/'.vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_Start', s:current_syntax).'/' + \ . ' end=/'.vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_End', s:current_syntax).'/me=s-1 transparent fold' endfor @@ -233,8 +235,9 @@ execute 'syntax match VimwikiList /'.vimwiki#vars#get_syntaxlocal('rxListDefine' execute 'syntax match VimwikiListTodo /'.vimwiki#vars#get_syntaxlocal('rxListItem').'/' if vimwiki#vars#get_global('hl_cb_checked') == 1 - execute 'syntax match VimwikiCheckBoxDone /'.vimwiki#vars#get_syntaxlocal('rxListItemWithoutCB').'\s*\['.vimwiki#vars#get_syntaxlocal('listsyms_list')[4].'\]\s.*$/ '. - \ 'contains=VimwikiNoExistsLink,VimwikiLink,@Spell' + execute 'syntax match VimwikiCheckBoxDone ' + \ . ' /'.vimwiki#vars#get_syntaxlocal('rxListItemWithoutCB').'\s*\['.vimwiki#vars#get_syntaxlocal('listsyms_list')[4].'\]\s.*$/' + \ . ' contains=VimwikiNoExistsLink,VimwikiLink,@Spell' elseif vimwiki#vars#get_global('hl_cb_checked') == 2 execute 'syntax match VimwikiCheckBoxDone /'.vimwiki#vars#get_syntaxlocal('rxListItemAndChildren').'/ contains=VimwikiNoExistsLink,VimwikiLink,@Spell' endif