From 261ad8c6df5321e153157935c7173c38d15b02bc Mon Sep 17 00:00:00 2001 From: itchyny Date: Fri, 23 Aug 2013 00:02:14 +0900 Subject: [PATCH] add my setting in README.md --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/README.md b/README.md index 1d235e0..fb23a60 100644 --- a/README.md +++ b/README.md @@ -287,3 +287,56 @@ Of course, you can name your component as you wish. ``` This is the end of the tutorial. For more information, see `:help lightline`. Good luck with your nice statuslines. + +### My setting +Here's my setting. I use the patched font for vim-powerline. +```vim + let g:lightline = { + \ 'colorscheme': 'landscape', + \ 'mode_map': { 'c': 'NORMAL' }, + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ] + \ }, + \ 'component_func': { + \ 'modified': 'MyModified', + \ 'readonly': 'MyReadonly', + \ 'fugitive': 'MyFugitive', + \ 'filename': 'MyFilename', + \ 'fileformat': 'MyFileformat', + \ 'filetype': 'MyFiletype', + \ 'fileencoding': 'MyFileencoding', + \ 'mode': 'MyMode', + \ }, + \ 'separator': { 'left': '⮀', 'right': '⮂' }, + \ 'subseparator': { 'left': '⮁', 'right': '⮃' } + \ } + function! MyModified() + return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-' + endfunction + function! MyReadonly() + return &ft !~? 'help\|vimfiler\|gundo' && &ro ? '⭤' : '' + endfunction + function! MyFilename() + return ('' != MyReadonly() ? MyReadonly() . ' ' : '') . + \ (&ft == 'vimfiler' ? vimfiler#get_status_string() : + \ &ft == 'unite' ? unite#get_status_string() : + \ &ft == 'vimshell' ? substitute(b:vimshell.current_dir,expand('~'),'~','') : + \ '' != expand('%t') ? expand('%t') : '[No Name]') . + \ ('' != MyModified() ? ' ' . MyModified() : '') + endfunction + function! MyFugitive() + return &ft !~? 'vimfiler\|gundo' && exists('*fugitive#head') && len(fugitive#head()) ? '⭠ '.fugitive#head() : '' + endfunction + function! MyFileformat() + return winwidth('.') > 60 ? &fileformat : '' + endfunction + function! MyFiletype() + return winwidth('.') > 60 ? &filetype: '' + endfunction + function! MyFileencoding() + return winwidth('.') > 60 ? (strlen(&fenc) ? &fenc : &enc) : '' + endfunction + function! MyMode() + return winwidth('.') > 60 ? lightline#mode() : '' + endfunction +```