diff options
Diffstat (limited to 'vim/.vim/after/plugin')
-rw-r--r-- | vim/.vim/after/plugin/status.vim | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vim/.vim/after/plugin/status.vim b/vim/.vim/after/plugin/status.vim new file mode 100644 index 0000000..54c5bb7 --- /dev/null +++ b/vim/.vim/after/plugin/status.vim @@ -0,0 +1,46 @@ +" Depends on vim-flagship +set showtabline=2 +let g:tabprefix = "" +let g:tablabel = "%N%{flagship#tabmodified()} %{TabCwd(v:lnum) != '' ? pathshorten(TabCwd(v:lnum)) : ''}" +let g:flagship_skip = 'FugitiveStatusline' + +function! Mixed_indent() + let l:spaces=search('\v(^ +)','n') + let l:tabs=search('\v(^\t+)','n') + return (l:spaces * l:tabs > 0) +endfunction + +function! GlobalCwd() + return getcwd(-1, -1) +endfunction + +function! TabCwd(number) + if haslocaldir(-1, a:number) + return getcwd(-1, a:number) + endif + return "" +endfunction + +function! WinCwd() + if haslocaldir(0) + return getcwd() + endif + return "" +endfunction + +augroup myflags + let status_line_bg = synIDattr(hlID("StatusLine"), "fg") + let status_line_fg = synIDattr(hlID("StatusLine"), "bg") + exe "highlight MyGlobals ctermfg=255 ctermbg=".status_line_bg + highlight MyGlobals ctermfg=255 ctermbg=240 + + autocmd! + autocmd CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:trailing=search('\s\+$','n') + autocmd CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:mixed=Mixed_indent() + autocmd User Flags call Hoist("buffer", "%{FugitiveHead('') != '' ? '['.FugitiveHead('').']' : ''}") + autocmd User Flags call Hoist("buffer", "%{b:trailing?'[tw]':''}") + autocmd User Flags call Hoist("buffer", "%{b:mixed?'[mixed]':''}") + autocmd User Flags call Hoist("buffer", "%{&paste?'[paste]':''}") + autocmd User Flags call Hoist("window", "%{WinCwd() != '' ? '['.WinCwd().']' : ''}") + autocmd User Flags call Hoist("global", {"hl": "MyGlobals"}, "[%{pathshorten(GlobalCwd())}, %{g:my_searchprgs[g:my_searchprg]}, %{g:my_findprgs[g:my_findprg]}]") +augroup END |