Last active
April 14, 2016 17:15
-
-
Save note103/950c9e240ce410e0f2a4b187d958058d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let g:lightline = { | |
| \ 'colorscheme': 'seoul256', | |
| \ 'mode_map': {'c': 'NORMAL'}, | |
| \ 'active': { | |
| \ 'right': [ [ 'syntastic', 'lineinfo' ], | |
| \ [ 'percent' ], [ 'winform' ], | |
| \ [ 'fileformat', 'fileencoding', 'filetype' ] ], | |
| \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'branch', 'filename' ] ] | |
| \ }, | |
| \ 'component_function': { | |
| \ 'linetotal': 'LightLineTotal', | |
| \ 'modified': 'LightLineModified', | |
| \ 'readonly': 'LightLineReadonly', | |
| \ 'fugitive': 'LightLineFugitive', | |
| \ 'filename': 'LightLineFilename', | |
| \ 'filepath': 'LightLineFilepath', | |
| \ 'fileformat': 'LightLineFileformat', | |
| \ 'filetype': 'LightLineFiletype', | |
| \ 'fileencoding': 'LightLineFileencoding', | |
| \ 'mode': 'LightLineMode', | |
| \ 'winform': 'LightLineWinform' | |
| \ }, | |
| \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" }, | |
| \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" }, | |
| \ 'component_expand': { | |
| \ 'syntastic': 'SyntasticStatuslineFlag', | |
| \ }, | |
| \ 'component_type': { | |
| \ 'syntastic': 'error', | |
| \ } | |
| \ } | |
| function! LightLineWinform() | |
| return winwidth(0) > 50 ? 'w' . winwidth(0) . ':' . 'h' . winheight(0) : '' | |
| endfunction | |
| function! LightLineModified() | |
| return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-' | |
| endfunction | |
| function! LightLineReadonly() | |
| return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? "⭤" : '' | |
| endfunction | |
| function! LightLineFilename() | |
| return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') . | |
| \ (&ft == 'vimfiler' ? vimfiler#get_status_string() : | |
| \ &ft == 'unite' ? unite#get_status_string() : | |
| \ &ft == 'vimshell' ? vimshell#get_status_string() : | |
| \ '' != expand('%') && winwidth(0) <=120 ? expand('%:t') : winwidth(0) >120 ? expand('%:p') : '[No Name]') . | |
| \ ('' != LightLineModified() ? ' ' . LightLineModified() : '') | |
| endfunction | |
| function! LightLineFilepath() | |
| return winwidth(0) <=120 ? expand('%:h') : '' | |
| endfunction | |
| function! LightLineFugitive() | |
| try | |
| if &ft !~? 'vimfiler\|gundo' && exists('*fugitive#head') && winwidth(0) > 55 | |
| let _ = fugitive#head() | |
| return strlen(_) ? '⭠ '._ : '' | |
| endif | |
| catch | |
| endtry | |
| return '' | |
| endfunction | |
| function! LightLineFileformat() | |
| return winwidth(0) > 80 ? &fileformat : '' | |
| endfunction | |
| function! LightLineFiletype() | |
| return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' | |
| endfunction | |
| function! LightLineFileencoding() | |
| return winwidth(0) > 60 ? (strlen(&fenc) ? &fenc : &enc) : '' | |
| endfunction | |
| function! LightLineMode() | |
| return winwidth(0) > 30 ? lightline#mode() : '' | |
| endfunction | |
| function! s:syntastic() | |
| SyntasticCheck | |
| call lightline#update() | |
| endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment