4a5142cfb33c

Custom powerline theme.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 17 Jan 2012 11:21:39 -0500
parents 7df6b989f544
children ff5bff57a284
branches/tags (none)
files vim/.vimrc vim/bundle/powerline-theme/powerline/sjl.vim vim/bundle/powerline-theme/powerline/sjl/00-default.vim vim/bundle/powerline-theme/powerline/sjl/50-command-t.vim vim/bundle/powerline-theme/powerline/sjl/50-gundo.vim vim/bundle/powerline-theme/powerline/sjl/50-help.vim vim/bundle/powerline-theme/powerline/sjl/50-lusty.vim vim/bundle/powerline-theme/powerline/sjl/50-manpage.vim vim/bundle/powerline-theme/powerline/sjl/50-syntastic.vim vim/bundle/powerline-theme/powerline/sjl/50-tagbar.vim

Changes

--- a/vim/.vimrc	Mon Jan 16 13:57:22 2012 -0500
+++ b/vim/.vimrc	Tue Jan 17 11:21:39 2012 -0500
@@ -918,16 +918,16 @@
 
 let g:EasyMotion_do_mapping = 0
 
-nnoremap <silent> <Leader>f      :call EasyMotionF(0, 0)<CR>
-onoremap <silent> <Leader>f      :call EasyMotionF(0, 0)<CR>
-vnoremap <silent> <Leader>f :<C-U>call EasyMotionF(1, 0)<CR>
+nnoremap <silent> <Leader>f      :call EasyMotion#F(0, 0)<CR>
+onoremap <silent> <Leader>f      :call EasyMotion#F(0, 0)<CR>
+vnoremap <silent> <Leader>f :<C-U>call EasyMotion#F(1, 0)<CR>
 
-nnoremap <silent> <Leader>F      :call EasyMotionF(0, 1)<CR>
-onoremap <silent> <Leader>F      :call EasyMotionF(0, 1)<CR>
-vnoremap <silent> <Leader>F :<C-U>call EasyMotionF(1, 1)<CR>
+nnoremap <silent> <Leader>F      :call EasyMotion#F(0, 1)<CR>
+onoremap <silent> <Leader>F      :call EasyMotion#F(0, 1)<CR>
+vnoremap <silent> <Leader>F :<C-U>call EasyMotion#F(1, 1)<CR>
 
-onoremap <silent> <Leader>t      :call EasyMotionT(0, 0)<CR>
-onoremap <silent> <Leader>T      :call EasyMotionT(0, 1)<CR>
+onoremap <silent> <Leader>t      :call EasyMotion#T(0, 0)<CR>
+onoremap <silent> <Leader>T      :call EasyMotion#T(0, 1)<CR>
 
 " }}}
 " Fugitive {{{
@@ -1018,6 +1018,7 @@
 " Powerline {{{
 
 let g:Powerline_symbols = 'fancy'
+let g:Powerline_theme = 'sjl'
 
 " }}}
 " Python-Mode {{{
@@ -1528,3 +1529,9 @@
 command! NyanMe call NyanMe()
 
 " }}}
+" Dtach ------------------------------------------------------------------- {{{
+
+vnoremap <localleader>e :<c-u>silent '<,'>w !dtach -s /tmp/target<cr>:silent !echo \| dtach -s /tmp/target<cr>
+nnoremap <localleader>e ^vg_:<c-u>silent '<,'>w !dtach -s /tmp/target<cr>
+
+" }}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,53 @@
+function! Stl_GetMode() " {{{
+	let ret = mode()
+
+	let ret = substitute(ret, '', '^V', 'g')
+
+	return ret
+endfunction " }}}
+function! Stl_GetBranch(branch_symbol) " {{{
+	let ret = fugitive#statusline()
+
+	let ret = substitute(ret, 'GIT(\([a-z0-9\-_\./:]\+\))', ' '. a:branch_symbol .' \1 ', 'gi')
+
+	return ret
+endfunction " }}}
+function! Stl_GetSyntaxErrors(line_symbol) " {{{
+	if ! exists('g:syntastic_stl_format')
+		" Syntastic hasn't been loaded yet
+		return ''
+	endif
+
+	" Temporarily change syntastic output format
+	let old_stl_format = g:syntastic_stl_format
+	let g:syntastic_stl_format = '╱╱╱%E{ ERRORS (%e) '. a:line_symbol .' %fe }%W{ WARNINGS (%w) '. a:line_symbol .' %fw }╱╱╱'
+
+	let ret = SyntasticStatuslineFlag()
+
+	let g:syntastic_stl_format = old_stl_format
+
+	return ret
+endfunction " }}}
+function! Stl_GetCurrentFunction() " {{{
+	return cfi#format(' %s', '')
+endfunction " }}}
+function! Stl_GetCommandTLine() " {{{
+	let line = getline('.')
+
+	" Trim whitespace from current line
+	let line = substitute(line, '\v^\>\s+|\s+$', '', 'g')
+
+	return line
+endfunction " }}}
+function! Stl_GetManPage() " {{{
+	let matches = matchlist(getline(1), '\v^([a-zA-Z_\.\-]+)\((\d+)\)')
+
+	if ! len(matches)
+		return 'n/a'
+	endif
+
+	let file = tolower(matches[1])
+	let num = matches[2]
+
+	return file
+endfunction " }}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/00-default.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,93 @@
+call Pl#Statusline(
+	\ Pl#Segment("  %-2{Stl_GetMode()} ",
+		\ Pl#HiCurrent(   Pl#FG( 22), Pl#BG(148), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG( 23), Pl#BG(231), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment("%{Stl_GetBranch('$branch')}",
+		\ exists('g:loaded_fugitive') && g:loaded_fugitive == 1,
+		\
+		\ Pl#HiCurrent(   Pl#FG(250), Pl#BG(240)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#FG(239), Pl#BG(235))
+		\ ),
+	\
+	\ Pl#SegmentGroup(
+		\ Pl#HiCurrent(   Pl#BG(240)),
+		\ Pl#HiInsert(    Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#BG(235)),
+		\
+		\ Pl#Segment("%{&readonly ? ' $ro' : ''}",
+			\ Pl#HiCurrent(   Pl#FG(196)),
+			\ Pl#HiInsert(    Pl#FG(196)),
+			\ Pl#HiNonCurrent(Pl#FG( 88))
+			\ ),
+		\ Pl#Segment(" %f ",
+			\ Pl#HiCurrent(   Pl#FG(231), Pl#Attr('bold')),
+			\ Pl#HiInsert(    Pl#FG(231), Pl#Attr('bold')),
+			\ Pl#HiNonCurrent(Pl#FG(245), Pl#Attr('bold'))
+			\ ),
+		\ Pl#Segment("%M ",
+			\ Pl#HiCurrent(   Pl#FG(196), Pl#Attr('bold')),
+			\ Pl#HiInsert(    Pl#FG(196), Pl#Attr('bold')),
+			\ Pl#HiNonCurrent(Pl#FG( 88))
+			\ ),
+		\  Pl#Segment("%H%W ",
+			\ Pl#HiCurrent(   Pl#FG(250)),
+			\ Pl#HiInsert(    Pl#FG(117)),
+			\ Pl#HiNonCurrent(Pl#FG(239))
+			\ ),
+		\ Pl#Segment("%{Stl_GetSyntaxErrors('$line')}",
+			\ exists('g:loaded_syntastic_plugin') && g:loaded_syntastic_plugin == 1,
+			\
+			\ Pl#HiCurrent(   Pl#FG(214), Pl#Attr('bold')),
+			\ Pl#HiInsert(    Pl#FG(214), Pl#Attr('bold')),
+			\ )
+		\ ),
+	\
+	\ Pl#Segment("%<%{Stl_GetCurrentFunction()}",
+		\ exists('g:cfi_disable') && g:cfi_disable == 0,
+		\
+		\ Pl#HiCurrent(   Pl#FG(247), Pl#BG(236)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 24))
+		\ ),
+	\
+	\ Pl#Split(
+		\ Pl#HiCurrent(   Pl#BG(236)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG(233))
+		\ ),
+	\
+	\ Pl#Segment("%{&fileformat} %{(&fenc == '' ? &enc : &fenc)} ",
+		\ Pl#HiCurrent(   Pl#FG(246), Pl#BG(236)),
+		\ Pl#HiInsert(    Pl#FG( 75), Pl#BG( 24))
+		\ ),
+	\
+	\ Pl#Segment(" $ft %{strlen(&ft) ? &ft : 'n/a'} ",
+		\ Pl#HiCurrent(   Pl#FG(246), Pl#BG(236)),
+		\ Pl#HiInsert(    Pl#FG( 75), Pl#BG( 24)),
+		\ ),
+	\
+	\ Pl#Segment(" %3p%% ",
+		\ Pl#HiCurrent(   Pl#FG(250), Pl#BG(240)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#FG(241), Pl#BG(234))
+		\ ),
+	\
+	\ Pl#SegmentGroup(
+		\ Pl#HiCurrent(   Pl#BG(252)),
+		\ Pl#HiInsert(    Pl#BG(117)),
+		\ Pl#HiNonCurrent(Pl#BG(235)),
+		\
+		\ Pl#Segment(" $line %3l",
+			\ Pl#HiCurrent(   Pl#FG(236), Pl#Attr('bold')),
+			\ Pl#HiInsert(    Pl#FG( 23), Pl#Attr('bold')),
+			\ Pl#HiNonCurrent(Pl#FG(245))
+			\ ),
+		\ Pl#Segment(":%-2c ",
+			\ Pl#HiCurrent(   Pl#FG(244)),
+			\ Pl#HiInsert(    Pl#FG( 23)),
+			\ Pl#HiNonCurrent(Pl#FG(241))
+			\ )
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-command-t.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,27 @@
+call Pl#Statusline(
+	\ Pl#Match('bufname("%")', 'GoToFile'),
+	\
+	\ Pl#Segment(' %{"Command-T"} ',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG(124), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment(' %<%{Stl_GetCommandTLine()}',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52))
+		\ ),
+	\
+	\ Pl#Split(
+		\ Pl#HiCurrent(   Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG( 52))
+		\ ),
+	\
+	\ Pl#Segment(" %10(Match #%l%) ",
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG(124)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-gundo.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,43 @@
+call Pl#Statusline(
+	\ Pl#Match('bufname("%")', '__Gundo__'),
+	\
+	\ Pl#Segment(' %{"Gundo"} ',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG(124), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment('%< %{"Undo tree"}',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52))
+		\ ),
+	\
+	\ Pl#Split(
+		\ Pl#HiCurrent(   Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG( 52))
+		\ )
+	\ )
+
+call Pl#Statusline(
+	\ Pl#Match('bufname("%")', '__Gundo_Preview__'),
+	\
+	\ Pl#Segment(' %{"Gundo"} ',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG(124), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment('%< %{"Diff preview"}',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG( 52))
+		\ ),
+	\
+	\ Pl#Split(
+		\ Pl#HiCurrent(   Pl#BG( 88)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG( 52))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-help.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,27 @@
+call Pl#Statusline(
+	\ Pl#Match('&ft', 'help'),
+	\
+	\ Pl#Segment(' %{"Help"} ',
+		\ 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('%< %t',
+		\ 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(" %3p%% ",
+		\ Pl#HiCurrent(   Pl#FG(250), Pl#BG(240)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-lusty.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,21 @@
+call Pl#Statusline(
+	\ Pl#Match('bufname("%")', '\[LustyExplorer-Buffers\]'),
+	\
+	\ Pl#Segment(' %{"LustyExplorer"} ',
+		\ 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('%< %{"Buffer list"}',
+		\ 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))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-manpage.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,27 @@
+call Pl#Statusline(
+	\ Pl#Match('&ft', 'man'),
+	\
+	\ Pl#Segment(' %{"Man page"} ',
+		\ Pl#HiCurrent(   Pl#FG(247), Pl#BG(240), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31), Pl#Attr('bold')),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment(' %{Stl_GetManPage()} %<',
+		\ 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#Split(
+		\ Pl#HiCurrent(   Pl#BG(236)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG(234))
+		\ ),
+	\
+	\ Pl#Segment(" %p%% ",
+		\ Pl#HiCurrent(   Pl#FG(250), Pl#BG(240)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 31)),
+		\ Pl#HiNonCurrent(Pl#FG(244), Pl#BG(234))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-syntastic.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,21 @@
+call Pl#Statusline(
+	\ Pl#Match('&ft', 'qf'),
+	\
+	\ Pl#Segment(' %{"Quickfix"} ',
+		\ 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('%< %{"Location List"}',
+		\ 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))
+		\ )
+	\ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/powerline-theme/powerline/sjl/50-tagbar.vim	Tue Jan 17 11:21:39 2012 -0500
@@ -0,0 +1,21 @@
+call Pl#Statusline(
+	\ Pl#Match('bufname("%")', '__Tagbar__'),
+	\
+	\ Pl#Segment(' %{"Tagbar"} ',
+		\ Pl#HiCurrent(   Pl#FG(231), Pl#BG( 70), Pl#Attr('bold')),
+		\ Pl#HiInsert(    Pl#FG(231), Pl#BG( 31), Pl#Attr('bold')),
+		\ Pl#HiNonCurrent(Pl#FG( 70), Pl#BG( 22), Pl#Attr('bold'))
+		\ ),
+	\
+	\ Pl#Segment('%< %{"Tree"}',
+		\ Pl#HiCurrent(   Pl#FG(148), Pl#BG( 28)),
+		\ Pl#HiInsert(    Pl#FG(117), Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#FG( 70), Pl#BG( 22))
+		\ ),
+	\
+	\ Pl#Split(
+		\ Pl#HiCurrent(   Pl#BG( 28)),
+		\ Pl#HiInsert(    Pl#BG( 24)),
+		\ Pl#HiNonCurrent(Pl#BG( 22))
+		\ )
+	\ )