Skip to content

Instantly share code, notes, and snippets.

@dduvnjak
Last active December 16, 2015 11:39
Show Gist options
  • Save dduvnjak/5429397 to your computer and use it in GitHub Desktop.
Save dduvnjak/5429397 to your computer and use it in GitHub Desktop.
Awesome prompt for bash and fish shell

To make you prompt look like this:

Prompt screenshot

Add this to your ~/.bash_profile

export PS1="\[$(tput setaf 6)\]\u\[$(tput sgr0)\]@\[$(tput setaf 6)\]\h\[$(tput setaf 3)\] \w\n\[$(tput sgr0)\]> "

Or this to your ~/.config/fish/config.fish (create it if it's not there):

# override the default prompt_pwd function
function prompt_pwd --description 'Print the current working directory, shortened to fit the prompt'
    echo $PWD  | sed -e "s|^$HOME|~|" -e 's|^/private||'

end

function fish_prompt
    set_color cyan
    echo -n (whoami)
    set_color normal
    echo -n '@'
    set_color cyan
    echo -n (hostname -s)
    set_color yellow
    echo ' '(prompt_pwd)
    set_color normal
    echo -n '> '
  end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment