diff --git a/lightline.vim b/lightline.vim index 574bf1b..b261007 100644 --- a/lightline.vim +++ b/lightline.vim @@ -1,11 +1,17 @@ +"" +"" Settings +"" + let g:lightline = { \"active": { \ "left": [[ "mode", "paste" ], \ ["fugitive", "filename", "readonly", "ctrlpmark"]], - \ "right": [ ["syntastic", "lineinfo"], ["percent"], - \ ["fileformat", "fileencoding", "filetype"]] + \ "right": [ ["syntastic", "percent"], + \ ["fileencoding", "filetype"]] \ }, - \"component": { + \'separator': { 'left': '', 'right': '' }, + \'subseparator': { 'left': '→', 'right': '∘' }, + \"component": { \"readonly": '%{&filetype=="help"?"":&readonly?"∅":""}', \"modified": '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}' \ }, @@ -22,7 +28,6 @@ let g:lightline = { \"component_function": { \ "filename": "Filename", \ "fugitive": "Fugitive", - \ "fileformat": "Fileformat", \ "filetype": "Filetype", \ "fileencoding": "Fileencoding", \ "mode": "Mode", @@ -30,16 +35,48 @@ let g:lightline = { \ } \ } + +"" +"" Color scheme +"" + +let s:p = {'normal': {}, 'inactive': {}, + \'insert': {}, 'replace' : {}, + \'visual': {}, 'tabline' : {}} + +let s:p.normal.left = [ [ 07, 14 ], [ 08, 00 ] ] +let s:p.insert.left = [ [ 07, 05 ], [ 14, 00 ] ] +let s:p.visual.left = [ [ 00, 03 ], [ 14, 00 ] ] +let s:p.replace.left = [ [ 00, 02 ], [ 14, 00 ] ] +let s:p.inactive.left = [ [ 12, 00 ], [ 15, 00 ] ] +let s:p.tabline.left = [ [ 14, 00 ] ] +let s:p.normal.right = [ [ 12, 00 ], [ 03, 00 ] ] +let s:p.tabline.right = [ [ 12, 00 ], [ 03, 00 ] ] +let s:p.inactive.right = [ [ 12, 00 ], [ 13, 00 ] ] +let s:p.normal.middle = [ [ 12, 00 ] ] +let s:p.inactive.middle = [ [ 12, 00 ] ] +let s:p.tabline.middle = [ [ 14, 00 ] ] +let s:p.tabline.tabsel = [ [ 14, 00 ] ] +let s:p.normal.error = [ [ 00, 05 ] ] +let s:p.normal.warning = [ [ 00, 02 ] ] + +let g:lightline#colorscheme#default#palette = lightline#colorscheme#fill(s:p) + + +"" +"" Function helpers +"" + function! Fugitive() if &ft !~? 'tagbar' && exists("*fugitive#head") let _ = fugitive#head() - return strlen(_) ? "μ "._ : "" + return strlen(_) ? "Σ "._ : "" endif return '' endfunction function! Modified() - return &ft =~ "help" ? "" : &modified ? "+" : &modifiable ? "" : "-" + return &ft =~ "help" ? "" : &modified ? "Δ" : &modifiable ? "" : "δ" endfunction function! Readonly() @@ -54,10 +91,6 @@ function! Filename() \ ('' != Modified() ? ' ' . Modified() : '') endfunction -function! Fileformat() - return winwidth(0) > 70 ? &fileformat : "" -endfunction - function! Filetype() return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : "no ft") : "" endfunction @@ -76,8 +109,9 @@ endfunction function! CtrlPMark() if expand("%:t") =~ "ControlP" call lightline#link("iR"[g:lightline.ctrlp_regex]) - return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item - \ , g:lightline.ctrlp_next], 0) + return lightline#concatenate([g:lightline.ctrlp_prev, + \ g:lightline.ctrlp_item, + \ g:lightline.ctrlp_next], 0) else return "" endif