Giter VIP home page Giter VIP logo

spaceship-prompt's Introduction

๐Ÿš€โญ Spaceship ZSH

NPM version Zsh Donate with card Donate with Bitcoin Donate with Ethereum

A Zsh prompt for Astronauts.

Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.

Currently it shows:

  • Clever hostname and username displaying.
  • Prompt character turns red if the last command exits with non-zero code.
  • Current Git branch and rich repo status:
    • ? โ€” untracked changes;
    • + โ€” uncommitted changes in the index;
    • ! โ€” unstaged changes;
    • ยป โ€” renamed files;
    • โœ˜ โ€” deleted files;
    • $ โ€” stashed changes;
    • = โ€” unmerged changes;
    • โ‡ก โ€” ahead of remote branch;
    • โ‡ฃ โ€” behind of remote branch;
    • โ‡• โ€” diverged chages.
  • Current Mercurial bookmark/branch and rich repo status:
    • ? โ€” untracked changes;
    • + โ€” uncommitted changes in the index;
    • ! โ€” unstaged changes;
    • โœ˜ โ€” deleted files;
  • Indicator for jobs in the background (โœฆ).
  • Current Node.js version, through nvm/nodenv/n (โฌข).
  • Current Ruby version, through rvm/rbenv/chruby/asdf (๐Ÿ’Ž).
  • Current Elixir version, through kiex/exenv/elixir (๐Ÿ’ง).
  • Current Swift version, through swiftenv (๐Ÿฆ).
  • Current Xcode version, through xenv (๐Ÿ› ).
  • Current Go version (๐Ÿน).
  • Current PHP version (๐Ÿ˜).
  • Current Rust version (๐—ฅ).
  • Current version of Haskell Tool Stack (ฮป).
  • Current Julia version (เฎƒ).
  • Current Docker version and connected machine (๐Ÿณ).
  • Current Amazon Web Services (AWS) profile (โ˜๏ธ) (Using named profiles).
  • Current Python virtualenv.
  • Current Conda virtualenv (๐Ÿ…’).
  • Current Python pyenv (๐Ÿ).
  • Current .NET SDK version, through dotnet-cli (.NET).
  • Current Ember.js version, through ember-cli (๐Ÿน).
  • Current Kubectl context (โ˜ธ๏ธ).
  • Package version, if there's is a package in current directory (๐Ÿ“ฆ).
  • Current battery level and status:
    • โ‡ก - charging;
    • โ‡ฃ - discharging;
    • โ€ข - fully charged.
  • Current Vi-mode mode (with handy aliases for temporarily enabling).
  • Optional exit-code of last command (how to enable).
  • Optional time stamps 12/24hr in format (how to enable).
  • Execution time of the last command if it exceeds the set threshold.

Want more features? Please, open an issue or send pull request.

Preview

Spaceship with Hyper and One Dark

You can find more examples with different color schemes in Screenshots wiki-page.

Requirements

For correct work you will first need:

  • zsh (v5.0.6 or recent) must be installed.
  • Powerline Font must be installed and used in your terminal.

Installing

npm install -g spaceship-prompt

Done. This command should link spaceship.zsh as prompt_spaceship_setup to your $fpath and set prompt spaceship in .zshrc. Just reload your terminal.

๐Ÿ’ก Tip: Update Spaceship to new versions as any other package.

Clone this repo:

git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"

Symlink spaceship.zsh-theme to your oh-my-zsh custom themes directory:

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

Set ZSH_THEME="spaceship" in your .zshrc.

  • Follow prezto-contrib#usage to clone prezto-contrib to the proper location.
  • Enable the contrib-prompt module (before the prompt module).
  • Set zstyle ':prezto:module:prompt' theme 'spaceship' in your .zpreztorc.

Add the following snippet in your ~/.zshrc:

antigen theme https://github.com/denysdovhan/spaceship-prompt spaceship

Update your .zshrc file with the following line:

antibody bundle denysdovhan/spaceship-prompt

Add the following line to your ~/.zshrc where you're adding your other Zsh plugins:

zgen load denysdovhan/spaceship-prompt spaceship

Use this command in your .zshrc to load Spaceship as prompt theme:

zplug denysdovhan/spaceship-prompt, use:spaceship.zsh, from:github, as:theme

Linux package manager

Arch Linux

Install the latest master from the AUR package spaceship-prompt-git:

git clone https://aur.archlinux.org/spaceship-prompt-git.git
cd spaceship-prompt-git
makepkg -si

Manual

If you have problems with approches above, follow these instructions:

  • Clone this repo git clone https://github.com/denysdovhan/spaceship-prompt.git
  • Symlink spaceship.zsh to somewhere in $fpath as prompt_spaceship_setup.
  • Initialize prompt system and choose spaceship.

Example

Run echo $fpath to see possible location and link spaceship.zsh there, like:

$ ln -sf "$PWD/spaceship.zsh" "/usr/local/share/zsh/site-functions/prompt_spaceship_setup"

For a user-specific installation, simply add a directory to $fpath for that user in .zshrc:

fpath=( "$HOME/.zfunctions" $fpath )

Then install the theme like this:

$ ln -sf "$PWD/spaceship.zsh" "$HOME/.zfunctions/prompt_spaceship_setup"

For initializing prompt system add this to your .zshrc:

# .zshrc
autoload -U promptinit; promptinit
prompt spaceship

Customization

Spaceship works well out of the box, but you can customize almost everything if you want.

  • Options โ€” Tweak section's behavior with tons of options.
  • API โ€” Define a custom section that will do exactly what you want.

You have ability to customize or disable specific elements of Spaceship. All options must be overridden in your .zshrc file after the theme.

Also, take a look at popular option presets or share your own configuration on Presets wiki page.

Troubleshooting

Have a trouble? Take a look at out Troubleshooting page.

Still struggling? Please, file an issue, describe your problem and we will gladly help you.

Team

Denys Dovhan Salmanul Farzy Maxim Baz
Denys Dovhan Salmanul Farzy Maxim Baz

Donate

Hi! I work on this project in my spare time, beside my primary job. I hope enjoy using Spaceship, and if you do, please, buy me a cup of tea โ˜•๏ธ.

Credit/Debit card Bitcoin Ethereum
Donate with LiqPay 1FrPrQb6ACTkbSBAz9PduJWrDFfq41Ggb4 0x6aF39C917359897ae6969Ad682C14110afe1a0a1

I would appreciate your support! Thank you!

License

MIT ยฉ Denys Dovhan

spaceship-prompt's People

Contributors

denysdovhan avatar salmanulfarzy avatar maximbaz avatar asonix avatar rolfkoenders avatar poissonballon avatar bleys avatar igorcoding avatar segevfiner avatar thebluejay avatar gillchristian avatar lautis avatar arttse avatar mawburn avatar abnersajr avatar kulkarnih avatar runrioter avatar memoryonrepeat avatar bric3 avatar nelsonghezzi avatar shihanng avatar nfischer avatar krismichalski avatar zeotyn avatar musically-ut avatar scriptdaemon avatar belak avatar anton-johansson avatar ggarek avatar jgreat avatar

Watchers

Jirat Ki. avatar James Cloos 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.