Skip to content

Instantly share code, notes, and snippets.

@Phize
Created January 14, 2012 10:32
Show Gist options
  • Save Phize/1610914 to your computer and use it in GitHub Desktop.
Save Phize/1610914 to your computer and use it in GitHub Desktop.
Vim statusline for ref.vim with vim-powerline.
autocmd BufFilePost \[ref-*:*\] call Pl#UpdateStatusline(1)
call Pl#Statusline(
\ Pl#Match('bufname("%")', '^\[ref-(.+):(.*)\]$'),
\
\ Pl#Segment(' %{"Ref"} ',
\ Pl#HiCurrent( Pl#FG(231), Pl#BG(240), Pl#Attr('bold')),
\ Pl#HiInsert( Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold'))
\ ),
\
\ Pl#Segment('%< %{substitute(bufname("%"), "\^\\v\\[ref-\(\.\+\):\(\.\*\)\\]\$", "\\u\\1", "")} ',
\ Pl#HiCurrent( Pl#FG(247), Pl#BG(236)),
\ Pl#HiInsert( Pl#FG(117), Pl#BG( 24)),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234))
\ ),
\
\ Pl#Segment('%< %{substitute(bufname("%"), "\^\\v\\[ref-\(\.\+\):\(\.\*\)\\]\$", "\\2", "")}',
\ Pl#HiCurrent( Pl#FG(247), Pl#BG(236)),
\ Pl#HiInsert( Pl#FG(117), Pl#BG( 24)),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234))
\ ),
\
\ Pl#Split(
\ Pl#HiCurrent( Pl#BG(236)),
\ Pl#HiInsert( Pl#BG( 24)),
\ Pl#HiNonCurrent(Pl#BG(234))
\ ),
\
\ Pl#Segment(" %p%%/%L ",
\ Pl#HiCurrent( Pl#FG(250), Pl#BG(240)),
\ Pl#HiInsert( Pl#FG(117), Pl#BG( 31)),
\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234))
\ )
\ )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment