Crates.io | silver |
lib.rs | silver |
version | 2.0.1 |
source | src |
created_at | 2018-07-09 21:27:16.158876 |
updated_at | 2022-01-19 02:37:49.586221 |
description | A cross-shell customizable powerline-like prompt with icons |
homepage | |
repository | https://github.com/reujab/silver |
max_upload_size | |
id | 73545 |
size | 65,858 |
A cross-shell customizable powerline-like prompt heavily inspired by Agnoster. The faster rust port of bronze.
Unlike most shell prompts, silver is not written in shell script, but entirely in Rust.
When silver init
is run, it outputs shell code that sets your left prompt to run silver lprompt
and right prompt to silver rprompt
, which output the actual prompt.
Since silver is not written in shell script, it should theoretically be compatible with any shell, but the supported shells are Powershell, Bash, Zsh, fish, Ion and Elvish.
To be able to use the custom icons (which are enabled by default), you must patch your font or install a pre-patched font from Nerd Fonts.
cargo install --git https://github.com/reujab/silver
PATH
environment variableOn macOS, you will have to do a bit more:
brew install coreutils
brew install openssl
alias date="gdate"
to your shell configNow that you have silver installed, you need to configure it. To have your prompt look like the one in the screenshot above, create silver.toml
with the following content:
[[left]]
name = "dir"
color.background = "blue"
color.foreground = "black"
[[left]]
name = "git"
color.background = "green"
color.foreground = "black"
[[right]]
name = "status"
color.background = "white"
color.foreground = "black"
[[right]]
name = "cmdtime"
color.background = "magenta"
color.foreground = "black"
[[right]]
name = "shell"
color.background = "green"
color.foreground = "black"
Now that silver is configured, you need to evaluate its bootstrap code.
~/.bashrc
:
source <(silver init)
~/.config/ion/initrc
:
eval $(silver init)
Invoke-Expression -Command $(silver init | Out-String)
See zsh plugin
See fish plugin
See elvish plugin
Documentation is available on the wiki.
src/
modules/
cmdtime.rs
cmdtime
moduledir.rs
dir
moduleenv.rs
env
modulegit.rs
git
modulemod.rs
os.rs
os
modulestatus.rs
status
moduletime.rs
time
moduleuser.rs
user
modulevirtualenv.rs
virtualenv
modulecli.rs
config.rs
icons.rs
init.bash
init.ion
init.ps1
main.rs
print.rs
sh.rs