Skip to content

Commit

Permalink
Merge pull request #115 from kevwil/eval-doc-fix
Browse files Browse the repository at this point in the history
document how to use `-eval` and `-modules-right` options
  • Loading branch information
justjanne authored Feb 15, 2019
2 parents e7e0926 + 739d68f commit ccb1f06
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,56 @@ Usage of powerline-go:
Minimum width of a segment, segments longer than this will be shortened if space is limited. Setting this to 0 disables it.
(default 16)
```
### Eval

If using `eval` and `-modules-right` is desired, the shell setup must be modified slightly, as shown below:

##### Bash

Add the following to your `.bashrc` (or `.profile` on Mac):

```bash
function _update_ps1() {
eval "$($GOPATH/bin/powerline-go -error $? -eval -modules-right git)"
}

if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
```

##### ZSH

Add the following to your `.zshrc`:

```bash
function powerline_precmd() {
eval "$($GOPATH/bin/powerline-go -error $? -shell zsh -eval -modules-right git)"
}

function install_powerline_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" ]; then
install_powerline_precmd
fi
```

##### Fish

Redefine `fish_prompt` in `~/.config/fish/config.fish`:

```bash
function fish_prompt
eval $GOPATH/bin/powerline-go -error $status -shell bare -eval -modules-right git
end
```

### Path Aliases

Expand Down

0 comments on commit ccb1f06

Please sign in to comment.