Friday, August 24, 2012

Re: How to use virtualenv in Vim ?

On Friday, August 24, 2012 4:27:48 AM UTC-5, Pain Nagato wrote:
> I added plugin virtualenv (https://github.com/jmcantrell/vim-virtualenv) into my
>
> runtimepath.
>
>
>
> I'm new to virtualenv. The Vim plugin virtualenv has a function for statusline
>
> show the virutalenv name. I added it into my statusline option like this:
>
> set statusline+=\ \%{virtualenv#statusline()}
>
> And I also add this virtualenv segment into Powerline statusline.
>
> call Pl#Theme#InsertSegment('virtualenv', 'after', 'hgrev')
>
>
>
> I execute some commands:
>
> $ virtualenv test
>
> $ source bin/activate
>
> $ python bin/activate_this.py
>
> $ vim test.py
>
> Then I do not see the virtualenv name in statusline, both original statusline
>
> and Powerline statusline.
>
>
>
> Does anybody knows what I should do ? Thanks very much.
>
>
>

I have no idea what PowerLine does or how it works. Probably it messes with your statusline option. Try disabling PowerLine temporarily to get the statusline working before you start trying to get it working in PowerLine.

I do note that you don't seem to specify the function to call when you pass it into the PowerLine interface, that seems fishy to me. Maybe that's your only issue.

When you have your Vim in a situation where you'd expect something to show in your statusline, try echoing the result of the function manually, with :echo virtualenv#statusline(), to make sure it shows what you'd expect.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment