Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f542013d56
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 74 lines (61 sloc) 1.87 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
" Powerline - The ultimate statusline utility
"
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
" Source repository: https://github.com/Lokaltog/vim-powerline

" Script initialization {{{
if exists('g:Powerline_loaded') || &compatible || version < 702
finish
endif

let g:Powerline_loaded = 1
" }}}
" Commands {{{
command! PowerlineClearCache call Pl#ClearCache()
command! PowerlineReloadColorscheme call Pl#ReloadColorscheme()
" }}}
" Set default options {{{
for [s:key, s:value] in items({
\ 'theme' : 'default'
\ , 'colorscheme' : 'default'
\ , 'symbols' : 'compatible'
\ , 'symbols_override' : {}
\ , 'dividers_override': []
\ , 'stl_path_style' : 'relative'
\ , 'cache_enabled' : 1
\ })

if ! exists('g:Powerline_' . s:key)
exec printf('let g:Powerline_%s = %s', s:key, string(s:value))
endif

unlet! s:key s:value
endfor

if ! exists('g:Powerline_cache_dir')
let g:Powerline_cache_dir = simplify(expand('<sfile>:p:h') .'/..')
endif

if ! exists('g:Powerline_cache_file')
exec 'let g:Powerline_cache_file = '. string(printf('%s/Powerline_%s_%s_%s.cache'
\ , g:Powerline_cache_dir
\ , g:Powerline_theme
\ , g:Powerline_colorscheme
\ , g:Powerline_symbols
\ ))
endif
" }}}
" Autocommands {{{
function! s:CreateAutocmds()
augroup PowerlineMain
autocmd!

" Reload statuslines when changing color scheme
autocmd ColorScheme *
\ call Pl#Load()

autocmd BufEnter,WinEnter,FileType,BufUnload *
\ call Pl#UpdateStatusline(1)

autocmd BufLeave,WinLeave *
\ call Pl#UpdateStatusline(0)

autocmd BufWritePost */autoload/Powerline/Colorschemes/*.vim
\ :PowerlineReloadColorscheme
augroup END
endfunction

augroup PowerlineStartup
autocmd!

autocmd VimEnter * call s:CreateAutocmds() | call Pl#UpdateStatusline(1)
augroup END
" }}}
Something went wrong with that request. Please try again.