GithubHelp home page GithubHelp logo

cycomanic / xontrib-prompt-starship Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anki-code/xontrib-prompt-starship

0.0 1.0 0.0 48 KB

Starship cross-shell prompt in xonsh shell.

License: MIT License

Python 100.00%

xontrib-prompt-starship's Introduction

Starship cross-shell prompt in xonsh shell.

If you like the idea click โญ on the repo and tweet.

Additional features:

  • You can split the prompt to left, right and bottom parts.

Installation

To install use pip:

# You already have Starship installed. Then:
xpip install xontrib-prompt-starship
# or: xpip install -U git+https://github.com/anki-code/xontrib-prompt-starship

Usage

xontrib load prompt_starship

Recommendation

We suggest to use @ character to remember about you're using xonsh syntax and to potentially spread the word about xonsh if you make a screenshot or show your terminal to friends or collegues. Add this to your ~/.config/starship.toml:

[character]
success_symbol = "[@](bold green)"
error_symbol = "[@](bold red)"

If you're using Starship for both for another shell and for xonsh and you want to have different characters you can just put the lines above to the new ~/.config/starship_xonsh.toml file. Then you should add to the ~/.xonshrc:

$STARSHIP_CONFIG = '~/.config/starship_xonsh.toml'
xontrib load prompt_starship

Configuration

You can set the different starship configs for left, right and bottom parts of prompt when your shell type is prompt-toolkit:

$XONTRIB_PROMPT_STARSHIP_LEFT_CONFIG = "~/.config/starship_xonsh_left.toml"
$XONTRIB_PROMPT_STARSHIP_RIGHT_CONFIG = "~/.config/starship_xonsh_right.toml"
$XONTRIB_PROMPT_STARSHIP_BOTTOM_CONFIG = "~/.config/starship_xonsh_bottom.toml"
xontrib load prompt_starship

In case of using starship as part of another prompt you can add starship prompt to $PROMPT_FIELDS without replacing the current prompt:

$XONTRIB_PROMPT_STARSHIP_REPLACE_PROMPT = False
xontrib load prompt_starship
print($PROMPT_FIELDS['starship_left']())

Result:

Prompt bar with starship sections.

Known issues

Credits

xontrib-prompt-starship's People

Contributors

anki-code avatar eugenesvk avatar ofek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.