A better integration of virtualenv to avoid override other extensions

This commit is contained in:
joe di castro 2013-08-25 17:14:12 +02:00
parent 086b924992
commit f37eeeb9af
2 changed files with 5 additions and 3 deletions

View File

@ -49,7 +49,7 @@ vim-airline provides seamless integration with a variety of plugins. These exte
![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png)
### [virtualenv][31]
![image](https://f.cloud.github.com/assets/390964/1021386/73ed49e4-0cfc-11e3-96df-8d5084cde7da.png)
![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png)
# Rationale

View File

@ -7,7 +7,9 @@ endfunction
function! airline#extensions#virtualenv#apply(...)
if &filetype == "python"
let w:airline_section_x = '%{virtualenv#statusline()} '.g:airline_section_x
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