Skip to content

Commit

Permalink
Update vim-powerline and add a new trailing whitespace marker segment
Browse files Browse the repository at this point in the history
That has been recently added to vim-powerline:
Lokaltog/vim-powerline@d885f90
  • Loading branch information
pjg committed Feb 29, 2012
1 parent 54aca10 commit 43bea5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
22 changes: 4 additions & 18 deletions .vimrc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -440,25 +440,11 @@ set laststatus=2
" vim-powerline " vim-powerline
let g:Powerline_symbols = 'unicode' let g:Powerline_symbols = 'unicode'


" insert custom Powerline 'raw" Segment " insert trailing whitespace marker segment
call Pl#Theme#InsertSegment(['raw', '%{StatuslineTabWarning()}%{StatuslineTrailingSpaceWarning()}'], 'after', 'fileinfo') call Pl#Theme#InsertSegment('ws_marker', 'after', 'lineinfo')

" recalculate the trailing whitespace warning when idle and after saving
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning

"return '[\s]' if trailing white space is detected
"return '' otherwise
function! StatuslineTrailingSpaceWarning()
if !exists("b:statusline_trailing_space_warning")
if search('\s\+$', 'nw') != 0
let b:statusline_trailing_space_warning = '[\s]'
else
let b:statusline_trailing_space_warning = ''
endif
endif
return b:statusline_trailing_space_warning
endfunction


" insert tab indenting warning segment
call Pl#Theme#InsertSegment(['raw', '%{StatuslineTabWarning()}'], 'after', 'fileinfo')


"recalculate the tab warning flag when idle and after writing "recalculate the tab warning flag when idle and after writing
autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning
Expand Down

0 comments on commit 43bea5f

Please sign in to comment.