Modified setings of lightline to match the README in the lightline project Added indication of paste mode, added functions instead of code in call of components, added git branch glyph, added path to file being edited

This commit is contained in:
Jonas Bygdén
2014-11-11 14:53:28 +01:00
parent 000c376aab
commit 35c32f386a

View File

@@ -1,19 +1,40 @@
let g:lightline = { let g:lightline = {
\ 'colorscheme': 'solarized', \ 'colorscheme': 'solarized',
\ 'active': { \ 'active': {
\ 'left': [ [ 'mode' ], \ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ] \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ }, \ },
\ 'component': { \ 'component_function': {
\ 'readonly': '%{&readonly?"⭤":""}', \ 'fugitive': 'MyFugitive',
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}' \ 'readonly': 'MyReadonly',
\ }, \ 'filename': 'MyFilename',
\ 'component_visible_condition': {
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
\ }, \ },
\ 'separator': { 'left': '⮀', 'right': '⮂' }, \ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' } \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ } \ }
function! MyReadonly()
if &filetype == "help"
return ""
elseif &readonly
return "⭤ "
else
return ""
endif
endfunction
function! MyFugitive()
if exists("*fugitive#head")
let _ = fugitive#head()
return strlen(_) ? '⭠ '._ : ''
endif
return ''
endfunction
function! MyFilename()
return ('' != MyReadonly() ? MyReadonly() . ' ' : '') .
\ ('' != expand('%') ? expand('%') : '[NoName]')
endfunction
" Use status bar even with single buffer " Use status bar even with single buffer
set laststatus=2 set laststatus=2