All Projects → nbari → slick

nbari / slick

Licence: BSD-3-Clause license
async ZSH prompt

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to slick

Spaceship Prompt
🚀⭐ A Zsh prompt for Astronauts
Stars: ✭ 15,748 (+74890.48%)
Mutual labels:  prompt
impromptu.nvim
Create prompts fast and easy
Stars: ✭ 39 (+85.71%)
Mutual labels:  prompt
justified
Wrap, align and justify the words in a string.
Stars: ✭ 30 (+42.86%)
Mutual labels:  prompt
Mercury
Mercury is a hacking tool used to collect information and use the information to further hurt the target
Stars: ✭ 236 (+1023.81%)
Mutual labels:  prompt
react-st-modal
Simple and flexible modal dialog component for React JS
Stars: ✭ 41 (+95.24%)
Mutual labels:  prompt
ax5ui-dialog
Javascript UI Component - Dialog - JavaScript Dialog / Bootstrap Dialog
Stars: ✭ 29 (+38.1%)
Mutual labels:  prompt
Common
A simple, clean and minimal prompt.
Stars: ✭ 213 (+914.29%)
Mutual labels:  prompt
inquire
A Rust library for building interactive prompts
Stars: ✭ 419 (+1895.24%)
Mutual labels:  prompt
terminer
Upgrade your terminal experience with a single command.
Stars: ✭ 28 (+33.33%)
Mutual labels:  prompt
cli-autocomplete
A command line prompt with autocompletion.
Stars: ✭ 27 (+28.57%)
Mutual labels:  prompt
Silver
A cross-shell customizable powerline-like prompt with icons
Stars: ✭ 238 (+1033.33%)
Mutual labels:  prompt
prompt-password-strength
Custom mask function for prompt-password that adds a 'strength progress meter' that changes color as the password strength increases. Uses zxcvbn, the popular password strength estimation tool brought to you by dropbox.
Stars: ✭ 18 (-14.29%)
Mutual labels:  prompt
bureau
💻 Informative and fast ZSH prompt with git status. Works well with HUGE repositories. Show username, hostname, path, git branch and status.
Stars: ✭ 27 (+28.57%)
Mutual labels:  prompt
Cli Prompt
Allows you to prompt for user input on the command line, and optionally hide the characters they type
Stars: ✭ 228 (+985.71%)
Mutual labels:  prompt
requestty
An easy-to-use collection of interactive cli prompts inspired by Inquirer.js.
Stars: ✭ 158 (+652.38%)
Mutual labels:  prompt
Inquirer.js
A collection of common interactive command line user interfaces.
Stars: ✭ 15,378 (+73128.57%)
Mutual labels:  prompt
credit-card-prompt
Credit card prompt with validation and address lookup
Stars: ✭ 13 (-38.1%)
Mutual labels:  prompt
whaaaaat
Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
Stars: ✭ 73 (+247.62%)
Mutual labels:  prompt
guri
A simple and fast Oh-My-Zsh theme
Stars: ✭ 19 (-9.52%)
Mutual labels:  prompt
prompt-list
This repository has been archived, use Enquirer instead.
Stars: ✭ 13 (-38.1%)
Mutual labels:  prompt

slick - async ZSH prompt

crates.io Build Status

example

How to use

Install:

cargo install slick

To install cargo:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

If in Linux you may need install this:

apt install -y build-essential libssl-dev pkg-config

check your PATH $HOME/.cargo/bin/slick:w

Then add this to your .zshrc:

zle -N zle-keymap-select
zle -N zle-line-init
zmodload zsh/datetime
autoload -Uz add-zsh-hook
add-zsh-hook precmd slick_prompt_precmd
add-zsh-hook preexec slick_prompt_preexec

typeset -g slick_prompt_data
typeset -g slick_prompt_timestamp

SLICK_PATH=$HOME/.cargo/bin/slick

function slick_prompt_refresh {
    local exit_status=$?
    read -r -u $1 slick_prompt_data
    PROMPT=$($SLICK_PATH prompt -k "$KEYMAP" -r $exit_status -d ${slick_prompt_data:-""} -t ${slick_prompt_timestamp:-$EPOCHSECONDS})
    unset slick_prompt_timestamp

    zle reset-prompt

    # Remove the handler and close the fd
    zle -F $1
    exec {1}<&-
}

function zle-line-init zle-keymap-select {
    PROMPT=$($SLICK_PATH prompt -k "$KEYMAP" -d ${slick_prompt_data:-""})
    zle && zle reset-prompt
}

function slick_prompt_precmd() {
    slick_prompt_data=""
    local fd
    exec {fd}< <($SLICK_PATH precmd)
    zle -F $fd slick_prompt_refresh
}

function slick_prompt_preexec() {
    slick_prompt_timestamp=$EPOCHSECONDS
}

customizations

Set this environment variables to change color/symbols, for example:

export SLICK_PROMPT_CMD_MAX_EXEC_TIME=3
export SLICK_PROMPT_ERROR_COLOR=88
export SLICK_PROMPT_GIT_ACTION_COLOR=1
export SLICK_PROMPT_GIT_BRANCH_COLOR=202
export SLICK_PROMPT_GIT_FETCH=0
export SLICK_PROMPT_GIT_MASTER_BRANCH_COLOR=white
export SLICK_PROMPT_GIT_REMOTE_COLOR=40
export SLICK_PROMPT_GIT_STAGED_COLOR=1
export SLICK_PROMPT_GIT_STATUS_COLOR=cyan
export SLICK_PROMPT_GIT_UNAME_COLOR=8
export SLICK_PROMPT_PATH_COLOR=blue
export SLICK_PROMPT_ROOT_COLOR="red"
export SLICK_PROMPT_ROOT_SYMBOL="#"
export SLICK_PROMPT_SSH_COLOR=2
export SLICK_PROMPT_SYMBOL="❯"
export SLICK_PROMPT_SYMBOL_COLOR=magenta
export SLICK_PROMPT_TIME_ELAPSED_COLOR=1
export SLICK_PROMPT_VICMD_COLOR="yellow"
export SLICK_PROMPT_VICMD_SYMBOL="❮"

SLICK_PROMPT_GIT_FETCH=0 prevents doing a git fetch

To prevent displaying the git user.name:

export SLICK_PROMPT_NO_GIT_UNAME=1

Inspired by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].