summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2018-09-26 22:05:22 +0200
committerDavid Kaufmann <astra@ionic.at>2018-09-26 22:05:22 +0200
commit954c0c506699961c39ea347a1e8b2d1694942aea (patch)
tree8cb4f096abfdcb88bd0375d207a413bfa98f2c61
parent25886fa0be445ff684d2de3a302f81842837bb3a (diff)
downloadconfig-954c0c506699961c39ea347a1e8b2d1694942aea.tar.gz
update powerline
-rw-r--r--home/.vim/autoload/Pl.vim9
-rw-r--r--home/.vim/autoload/Pl/Match.vim4
-rw-r--r--home/.vim/autoload/Powerline/Matches.vim22
-rw-r--r--home/.vim/plugin/Powerline.vim13
4 files changed, 27 insertions, 21 deletions
diff --git a/home/.vim/autoload/Pl.vim b/home/.vim/autoload/Pl.vim
index c933030..83edf6c 100644
--- a/home/.vim/autoload/Pl.vim
+++ b/home/.vim/autoload/Pl.vim
@@ -167,16 +167,17 @@
\ '\=a:args[submatch(1)]',
\ 'g')
endfunction " }}}
- function! Pl#UpdateStatusline(current) " {{{
+ function! Pl#UpdateStatusline(current, ...) " {{{
if empty(g:Pl#THEME)
" Load statuslines if they aren't loaded yet
call Pl#Load()
endif
- for i in range(0, len(g:Pl#THEME) - 1)
- if Pl#Match#Validate(g:Pl#THEME[i])
+ for i in range(len(g:Pl#THEME))
+ if Pl#Match#Validate(g:Pl#THEME[i], a:0 ? a:1 : 0)
" Update window-local statusline
- let &l:statusline = '%!Pl#Statusline('. i .','. a:current .')'
+ call setwinvar(a:0 ? a:1 : 0, '&statusline',
+ \ '%!Pl#Statusline('. i .','. a:current .')')
endif
endfor
endfunction " }}}
diff --git a/home/.vim/autoload/Pl/Match.vim b/home/.vim/autoload/Pl/Match.vim
index b05f585..93aa6d0 100644
--- a/home/.vim/autoload/Pl/Match.vim
+++ b/home/.vim/autoload/Pl/Match.vim
@@ -19,7 +19,7 @@ function! Pl#Match#Any(...) " {{{
return ['match', 'any', matches]
endfunction " }}}
-function! Pl#Match#Validate(theme) " {{{
+function! Pl#Match#Validate(theme, window) " {{{
let match = a:theme.matches[1]
if match == 'none'
@@ -33,7 +33,7 @@ function! Pl#Match#Validate(theme) " {{{
endif
for [eval, re] in matches
- if match(eval(eval), '\v'. re) != -1
+ if match(eval(eval), '\v\C'. re) != -1
return 1
endif
endfor
diff --git a/home/.vim/autoload/Powerline/Matches.vim b/home/.vim/autoload/Powerline/Matches.vim
index 5cce475..033c4be 100644
--- a/home/.vim/autoload/Powerline/Matches.vim
+++ b/home/.vim/autoload/Powerline/Matches.vim
@@ -1,13 +1,13 @@
let g:Powerline#Matches#matches = {
- \ 'command_t' : Pl#Match#Add('bufname("%")', 'GoToFile'),
- \ 'bt_help' : Pl#Match#Add('&bt' , 'help'),
- \ 'ft_man' : Pl#Match#Add('&ft' , 'man'),
- \ 'ft_qf' : Pl#Match#Add('&ft' , 'qf'),
- \ 'ft_vimpager' : Pl#Match#Add('&ft' , 'vimpager'),
- \ 'gundo_preview' : Pl#Match#Add('bufname("%")', '__Gundo_Preview__'),
- \ 'gundo_tree' : Pl#Match#Add('bufname("%")', '__Gundo__'),
- \ 'lustyexplorer' : Pl#Match#Add('bufname("%")', '\[LustyExplorer-Buffers\]'),
- \ 'minibufexplorer' : Pl#Match#Add('bufname("%")', '\-MiniBufExplorer\-'),
- \ 'tagbar' : Pl#Match#Add('&ft' , 'tagbar'),
- \ 'nerdtree' : Pl#Match#Add('&ft' , 'nerdtree'),
+ \ 'command_t' : Pl#Match#Add('bufname(winbufnr(a:window))', '^GoToFile$'),
+ \ 'bt_help' : Pl#Match#Add('getwinvar(a:window, "&bt")' , '^help$'),
+ \ 'ft_man' : Pl#Match#Add('getwinvar(a:window, "&ft")' , '^man$'),
+ \ 'ft_qf' : Pl#Match#Add('getwinvar(a:window, "&ft")' , '^qf$'),
+ \ 'ft_vimpager' : Pl#Match#Add('getwinvar(a:window, "&ft")' , 'vimpager'),
+ \ 'gundo_preview' : Pl#Match#Add('bufname(winbufnr(a:window))', '^__Gundo_Preview__$'),
+ \ 'gundo_tree' : Pl#Match#Add('bufname(winbufnr(a:window))', '^__Gundo__$'),
+ \ 'lustyexplorer' : Pl#Match#Add('bufname(winbufnr(a:window))', '\[LustyExplorer\-Buffers\]'),
+ \ 'minibufexplorer' : Pl#Match#Add('bufname(winbufnr(a:window))', '^\-MiniBufExplorer\-$'),
+ \ 'tagbar' : Pl#Match#Add('getwinvar(a:window, "&ft")' , '^tagbar$'),
+ \ 'nerdtree' : Pl#Match#Add('getwinvar(a:window, "&ft")' , '^nerdtree$'),
\ }
diff --git a/home/.vim/plugin/Powerline.vim b/home/.vim/plugin/Powerline.vim
index 4269d8c..e715677 100644
--- a/home/.vim/plugin/Powerline.vim
+++ b/home/.vim/plugin/Powerline.vim
@@ -46,7 +46,7 @@
endif
" }}}
" Autocommands {{{
- function! s:CreateAutocmds()
+ function! s:Startup()
augroup PowerlineMain
autocmd!
@@ -54,20 +54,25 @@
autocmd ColorScheme *
\ call Pl#Load()
- autocmd BufEnter,WinEnter,FileType,BufUnload *
+ autocmd BufEnter,WinEnter,FileType,BufUnload,CmdWinEnter *
\ call Pl#UpdateStatusline(1)
- autocmd BufLeave,WinLeave *
+ autocmd BufLeave,WinLeave,CmdWinLeave *
\ call Pl#UpdateStatusline(0)
autocmd BufWritePost */autoload/Powerline/Colorschemes/*.vim
\ :PowerlineReloadColorscheme
augroup END
+
+ let curwindow = winnr()
+ for window in range(1, winnr('$'))
+ call Pl#UpdateStatusline(window == curwindow, window)
+ endfor
endfunction
augroup PowerlineStartup
autocmd!
- autocmd VimEnter * call s:CreateAutocmds() | call Pl#UpdateStatusline(1)
+ autocmd VimEnter * call s:Startup()
augroup END
" }}}