[UPDATE][VIM] Change to lightline status-line
I wanted to try something else, lightline seems more fun than the vanilla statusline, and easier to modify than airline. This is the bare minimum of status bar for me, without powerline separators because I don't like them very much, and with basic vim-fugitive integration.
This commit is contained in:
parent
d9cf811724
commit
7134074e58
59
vim/.vimrc
59
vim/.vimrc
|
@ -61,9 +61,9 @@ Plug 'nanotech/jellybeans.vim'
|
|||
" Another nice dark theme
|
||||
Plug 'morhetz/gruvbox'
|
||||
" Fancy status bar
|
||||
Plug 'vim-airline/vim-airline'
|
||||
" Themes for airline
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
" Add the gruvbox theme to my status line
|
||||
Plug 'shinchu/lightline-gruvbox.vim'
|
||||
" }}}
|
||||
|
||||
" Minimum viable vim config {{{
|
||||
|
@ -197,6 +197,59 @@ let g:gruvbox_italic=1
|
|||
colorscheme gruvbox
|
||||
" }}}
|
||||
|
||||
" Lightline settings {{{
|
||||
""""""""""""""""""""
|
||||
let g:lightline={}
|
||||
" Use the gruvbox colorscheme
|
||||
let g:lightline.colorscheme='gruvbox'
|
||||
let g:lightline.active={
|
||||
\ 'left': [
|
||||
\ [ 'mode', 'paste' ],
|
||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ],
|
||||
\ [ 'spell' ],
|
||||
\ ],
|
||||
\ 'right': [
|
||||
\ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'fileformat', 'fileencoding', 'filetype' ],
|
||||
\ ]
|
||||
\ }
|
||||
let g:lightline.inactive={
|
||||
\ 'left': [
|
||||
\ [ 'filename' ],
|
||||
\ ],
|
||||
\ 'right': [
|
||||
\ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ ],
|
||||
\ }
|
||||
let g:lightline.component_function={
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'modified': 'LightlineModified',
|
||||
\ 'gitbranch': 'LightlineFugitive',
|
||||
\ }
|
||||
|
||||
" Lightline function wrappers {{{
|
||||
"""""""""""""""""""""""""""""
|
||||
" Show a lock icon when editing a read-only file when it makes sense
|
||||
function! LightlineReadonly()
|
||||
return &ft!~?'help\|vimfiler\|netrw' && &readonly ? '' : ''
|
||||
endfunction
|
||||
" Show a '+' when the buffer is modified, '-' if not, when it makes sense
|
||||
function! LightlineModified()
|
||||
return &ft=~'help\|vimfiler\|netrw' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
" Show branch name with nice icon in status line, when it makes sense
|
||||
function! LightlineFugitive()
|
||||
if &ft!~?'help\|vimfiler\|netrw' && exists('*fugitive#head')
|
||||
let branch=fugitive#head()
|
||||
return branch!=#'' ? ' '.branch : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" UltiSnips settings {{{
|
||||
""""""""""""""""""""
|
||||
" Insert mode trigger for expansion
|
||||
|
|
Loading…
Reference in a new issue