mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2025-03-03 03:32:11 +08:00
Merge pull request #180 from joedicastro/master
add virtualenv extension
This commit is contained in:
commit
9ca2aa9a8c
@ -7,7 +7,7 @@ Lean & mean statusline for vim that's light as air.
|
||||
# Features
|
||||
|
||||
* tiny core written with extensibility in mind ([open/closed principle][8]).
|
||||
* integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5] and [lawrencium][21].
|
||||
* integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [lawrencium][21] and [virtualenv][31]
|
||||
* looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
|
||||
* optimized for speed; it loads in under a millisecond.
|
||||
* extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||
@ -48,6 +48,9 @@ vim-airline provides seamless integration with a variety of plugins. These exte
|
||||
### hunks ([vim-gitgutter][29] & [vim-signify][30])
|
||||

|
||||
|
||||
### [virtualenv][31]
|
||||

|
||||
|
||||
# Rationale
|
||||
|
||||
There's already [powerline][2], why yet another statusline?
|
||||
@ -151,3 +154,4 @@ MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
[28]: https://github.com/chrisbra/csv.vim
|
||||
[29]: https://github.com/airblade/vim-gitgutter
|
||||
[30]: https://github.com/mhinz/vim-signify
|
||||
[31]: https://github.com/jmcantrell/vim-virtualenv
|
||||
|
@ -161,6 +161,10 @@ function! airline#extensions#load()
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'virtualenv_loaded', 1) && get(g:, 'airline#extensions#virtualenv#enabled', 1))
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
endif
|
||||
|
||||
if g:airline_section_warning == '__'
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
\ && exists(':SyntasticCheck')
|
||||
|
15
autoload/airline/extensions/virtualenv.vim
Normal file
15
autoload/airline/extensions/virtualenv.vim
Normal file
@ -0,0 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#virtualenv#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#virtualenv#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#apply(...)
|
||||
if &filetype == "python"
|
||||
if !exists('w:airline_section_x')
|
||||
let w:airline_section_x = g:airline_section_x
|
||||
endif
|
||||
let w:airline_section_x = '%{virtualenv#statusline()} '.g:airline_right_alt_sep.' '.w:airline_section_x
|
||||
endif
|
||||
endfunction
|
@ -169,7 +169,7 @@ extension.
|
||||
let g:airline_section_b (the fugitive/lawrencium branch indicator)
|
||||
let g:airline_section_c (bufferline or filename)
|
||||
let g:airline_section_gutter (readonly, csv)
|
||||
let g:airline_section_x (tagbar, filetype)
|
||||
let g:airline_section_x (tagbar, virtualenv, filetype)
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
let g:airline_section_warning (syntastic, whitespace)
|
||||
@ -253,6 +253,12 @@ ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
let g:airline#extensions#ctrlp#color_template = 'visual'
|
||||
let g:airline#extensions#ctrlp#color_template = 'replace'
|
||||
<
|
||||
*airline-virtualenv*
|
||||
|
||||
virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
||||
|
||||
* enable/disable virtualenv integration >
|
||||
let g:airline#extensions#virtualenv#enabled = 1
|
||||
|
||||
==============================================================================
|
||||
FUNCREFS *airline-funcrefs*
|
||||
|
Loading…
x
Reference in New Issue
Block a user