Comments (4)
This is possible, though not efficiently, eg for ZSH, based on the example from the README:
function powerline_precmd() {
powerline_cmd_result="$?"
PROMPT="$(~/go/bin/powerline-go -error $powerline_cmd_result -shell zsh -modules 'nix-shell,venv,user,host,ssh,cwd,perms,exit,root')"
RPROMPT="$(~/go/bin/powerline-go -error $powerline_cmd_result -shell zsh -modules 'git,hg,jobs,vgo')"
}
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
Just pick whichever modules you want to appear on the left and right for in the PROMPT
and RPROMPT
lines respectively. Of course this means executing the command twice, but the performance is still not too bad, still faster than the shell/python alternatives in my testing.
Would be nice to have better support for this though, perhaps we could export content to be split or eval'd in the shell or something.
Oh, and if you want your separator arrows pointing in the opposite direction for the right-aligned portion, I submitted #92 to allow drawing reversed separators.
from powerline-go.
Thank you for the reply!
Unfortunately, I'm not a zsh user and I prefer to shell-independent solution...
from powerline-go.
Unfortunately, I'm not a zsh user and I prefer to shell-independent solution
Then you're out of luck - zsh and fish are the only shells that I'm aware of that support right-aligned prompts.
from powerline-go.
Fixed thanks to @pdf’s PR
from powerline-go.
Related Issues (20)
- Fedora HOT 2
- Horizontal space on error HOT 1
- Docker context segment doesn't seem to recognize DOCKER_CONTEXT environment variable
- [Feature] Support for displaying Pulumi stack HOT 1
- Node segment shows up all the time if `node` is in the path.
- How to display git remote for tracking branch? HOT 2
- nix-shell segment uses a non-existent character HOT 2
- Shorten current working directory HOT 1
- Windows username is cropped
- modules-right not working in bash HOT 1
- Git staged tick is rendering grey, not white HOT 7
- Nice to have customizeable themes HOT 3
- No prompt in pyvenv.cfg makes venv incorrectly empty HOT 1
- Any plans to create new binaries? HOT 2
- Use the NIX_SHELL_PACKAGES variable in the nix-shell segment on Zsh
- Very slow startup for PowerShell 7.3.x on Windows 10
- [cwd] Display Unix-style path in Git Bash prompt
- venv style is incorrect
- direnv and venv segments HOT 3
- git tags for 1.24 release is not semver and cannot go install it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerline-go.