Whats in your .bashrc

If the prompt/command etc. executes without errors shows the green (or whatever color you assign) :check_mark:.
If there is a problem/error etc. shows the red (or whatever color you assign) ✘.

The commands whoami and uname -r are legit, so after :check_mark:, everything about …koukouroukou is bs, so ✘.

1 Like

More of a classic prompt, add mkcd…

PS1="\e[1;32m\u@\h \e[0;34m\W\\e[0;0m\n#!> "

# Make and Enter directory
mkcd() { mkdir "$1" && cd "$1"; }
mkd() {
        mkdir -p "$@" && cd "$_"
}

Not sure if zshrc can be applied, I used that longer…

in zshrc I used this one:

# Make and Enter directory
mkcd(){ mkdir "$1" && cd "$1" ; }
# Dracula TTY
if [ "$TERM" = "linux" ]; then
	printf %b '\e[40m' '\e[8]' # set default background to color 0 'dracula-bg'
	printf %b '\e[37m' '\e[8]' # set default foreground to color 7 'dracula-fg'
	printf %b '\e]P0282a36'    # redefine 'black'          as 'dracula-bg'
	printf %b '\e]P86272a4'    # redefine 'bright-black'   as 'dracula-comment'
	printf %b '\e]P1ff5555'    # redefine 'red'            as 'dracula-red'
	printf %b '\e]P9ff7777'    # redefine 'bright-red'     as '#ff7777'
	printf %b '\e]P250fa7b'    # redefine 'green'          as 'dracula-green'
	printf %b '\e]PA70fa9b'    # redefine 'bright-green'   as '#70fa9b'
	printf %b '\e]P3f1fa8c'    # redefine 'brown'          as 'dracula-yellow'
	printf %b '\e]PBffb86c'    # redefine 'bright-brown'   as 'dracula-orange'
	printf %b '\e]P4bd93f9'    # redefine 'blue'           as 'dracula-purple'
	printf %b '\e]PCcfa9ff'    # redefine 'bright-blue'    as '#cfa9ff'
	printf %b '\e]P5ff79c6'    # redefine 'magenta'        as 'dracula-pink'
	printf %b '\e]PDff88e8'    # redefine 'bright-magenta' as '#ff88e8'
	printf %b '\e]P68be9fd'    # redefine 'cyan'           as 'dracula-cyan'
	printf %b '\e]PE97e2ff'    # redefine 'bright-cyan'    as '#97e2ff'
	printf %b '\e]P7f8f8f2'    # redefine 'white'          as 'dracula-fg'
	printf %b '\e]PFffffff'    # redefine 'bright-white'   as '#ffffff'
	clear
fi

Also, after using zshrc I had a desire to see what my alias commands were, to help remember them (much like abbr in fish)… a couple of years back now, so maybe need a bit of fudging to make it work…

#-------- Global Alias {{{
globalias() {
  if [[ $LBUFFER =~ '[a-zA-Z0-9]+$' ]]; then
    zle _expand_alias
    zle expand-word
  fi
  zle self-insert
}
zle -N globalias
bindkey " " globalias                 # space key to expand globalalias
# bindkey "^ " magic-space            # control-space to bypass completion
bindkey "^[[Z" magic-space            # shift-tab to bypass completion
bindkey -M isearch " " magic-space    # normal space during searches

#}}}

Hmmmm not sure how to do that in bashrc… right now I have bind '\"\\C-e\": alias-expand-line' # Ctrl E a expands alias.

I also have the green/red status for my zsh prompt + thumb up/thumb down.

2 Likes