Bash Powerline not showing git branch info, but vi is working correctly. #186

Closed
felixgao opened this Issue Feb 7, 2013 · 12 comments

Comments

Projects
None yet

felixgao commented Feb 7, 2013

Screen Shot 2013-02-06 at 5 35 17 PM
but if I do vi set.py I do see git branch info
Screen Shot 2013-02-06 at 5 36 12 PM

in my vimrc i have the following
. /Users/felix/Personalization/powerline/powerline/bindings/bash/powerline.sh

running iterm2 1.0.0.20130204-nightly on OSX 10.8.2

also if someone can tell me how to add server info to my prompt that would be great.

Owner

Lokaltog commented Feb 7, 2013

You have to enable the default_leftonly theme in your user configuration.

@Lokaltog Lokaltog closed this Feb 7, 2013

I tried to do that but I have no idea how to "change my user configuration" :(
I'm using powerline from source (doing "pip install --user -e /home/daniel/workspace/powerline" and adding ". /home/daniel/workspace/powerline/powerline/bindings/bash/powerline.sh").

What should I change to get git branch on my prompt?

WOW I have just read the docs (https://powerline.readthedocs.org/en/latest/configuration.html) and understood! ( sorry about the comment above :S )

@danieltdt that documentation is confusing. I can't figure out which file to change (and what to change)

Ihsahn commented Oct 21, 2015

@DanielGGordon Either modify main config.json or make a local copy (into ~/.config/powerline) and change shell->theme from "default" to "default_leftonly"

thanx!

den-is commented Jan 20, 2016

I have followed all the steps but still have this problem on Fedora 23:
powerline-status (2.3) installed with pip2 (python 2.7.10)
have both pygit2 (0.22.1) for python2 and python3
created user config in ~/.config/powerline/config.json which works coz i can see that it applies colorscheme. but git still doesn't work

{
  "common": {
    "term_truecolor": false
  },
  "ext": {
    "ipython": {
      "colorscheme": "default",
      "theme": "in",
      "local_themes": {
        "rewrite": "rewrite",
        "out": "out",
        "in2": "in2"
      }
    },
    "shell": {
      "colorscheme": "solarized",
      "theme": "default_leftonly",
      "local_themes": {
        "continuation": "continuation",
        "select": "select"
      }
    },
    "tmux": {
      "colorscheme": "default",
      "theme": "default"
    }
  }
}

Edited main config .json in powerline install root/config_files - still nothing.

For the people from google:

mkdir -p ~/.config/powerline
cat <<-'EOF' > ~/.config/powerline/config.json
{
    "ext": {
        "shell": {
            "theme": "default_leftonly"
        }
    }
}
EOF
powerline-daemon --replace 

This works because configs are merged

I agree that the documentation for customization managed to be verbose and confusing at the same time. I still have no idea where is powerline_root on my setup.

@xenithorb worked for me btw ^^

meffect commented Mar 11, 2017

Are you saying there a master config.json of sorts? And ~/.config/powerline/config.json overrides matching keys?

The docs I was reading dont seem to efficaciously educate the json schema

meffect commented Mar 11, 2017

I found some language on a website after googling for more info. I think this is how it's supposed to be done to get the user started with the base/defaults. Then can edit as needed

I happen to install with pip --user , so my bits are in ~/.local/ ,

note: ~/.local/lib/python3.5/site-packages/... in path is variable depending on your system configuration

mkdir -p ~/.config/powerline && cp -R ~/.local/lib/python3.5/site-packages/powerline/config_files/* ~/.config/powerline/ && cd ~/.config/powerline && ls -alF --color=auto

Then as @xenithorb mentioned, edit ~/.config/powerline/config.json ext => shell => theme value from default to default_leftonly

ex:

{
        "common": {
                "term_truecolor": false
        },
        "ext": {
                "ipython": {
                        "colorscheme": "default",
                        "theme": "in",
                        "local_themes": {
                                "rewrite": "rewrite",
                                "out": "out",
                                "in2": "in2"
                        }
                },
                "pdb": {
                        "colorscheme": "default",
                        "theme": "default"
                },
                "shell": {
                        "colorscheme": "default",
                        "theme": "default_leftonly",
                        "local_themes": {
                                "continuation": "continuation",
                                "select": "select"
                        }
                },
                "tmux": {
                        "colorscheme": "default",
                        "theme": "default"
                },
                "vim": {
                        "colorscheme": "default",
                        "theme": "default",
                        "local_themes": {
                                "__tabline__": "tabline",

                                "cmdwin": "cmdwin",
                                "help": "help",
                                "quickfix": "quickfix",

                                "powerline.matchers.vim.plugin.nerdtree.nerdtree": "plugin_nerdtree",
                                "powerline.matchers.vim.plugin.commandt.commandt": "plugin_commandt",
                                "powerline.matchers.vim.plugin.gundo.gundo": "plugin_gundo",
                                "powerline.matchers.vim.plugin.gundo.gundo_preview": "plugin_gundo-preview"
                        }
                },
                "wm": {
                        "colorscheme": "default",
                        "theme": "default"
                }
        }
}

Also Note: If the daemon is running, the changes made to ~/.config/powerline/* files will be prevented from taking effect until you stop or restart the daemon. Check to see if the daemon is running with ps aux | grep powerline , Either way, the daemon can be started/restarted with powerline-daemon --replace

This was the command that I needed.

powerline-daemon --replace

Thanks @xenithorb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment