Move prompt management into bash configuration
Also add better history management. I've been using GNU screen for a while which messes up history for a lot of shells. Every shell will now append to and reread history after each command.
This commit is contained in:
parent
fd9dcb7053
commit
d0ea94c3f2
@ -8,9 +8,9 @@ alias sudo="sudo "
|
|||||||
#{- GNU COREUTILS -}#
|
#{- GNU COREUTILS -}#
|
||||||
|
|
||||||
# Sort directories first and colorize output
|
# Sort directories first and colorize output
|
||||||
alias ls="ls -h --color=auto --group-directories-first"
|
alias ls="ls -hF --color=auto --group-directories-first"
|
||||||
alias la="ls -A"
|
alias la="ls -AF"
|
||||||
alias ll="ls -l"
|
alias ll="ls -lF"
|
||||||
|
|
||||||
# Ask before overwriting files
|
# Ask before overwriting files
|
||||||
alias mv="mv -i"
|
alias mv="mv -i"
|
||||||
|
|||||||
27
bash/.bashrc
27
bash/.bashrc
@ -1,5 +1,32 @@
|
|||||||
#{- ~/.bashrc -}#
|
#{- ~/.bashrc -}#
|
||||||
|
|
||||||
|
#{- PROMPT -}#
|
||||||
|
|
||||||
|
red="\[\033[1;31m\]"
|
||||||
|
green="\[\033[1;32m\]"
|
||||||
|
yellow="\[\033[1;33m\]"
|
||||||
|
blue="\[\033[1;34m\]"
|
||||||
|
magenta="\[\033[1;35m\]"
|
||||||
|
cyan="\[\033[1;36m\]"
|
||||||
|
no_color="\[\033[0m\]"
|
||||||
|
|
||||||
|
# Interactive Prompt: "$ " in green
|
||||||
|
export PS1="${green}\$${no_color} "
|
||||||
|
# Continuation Prompt: "> " in cyan
|
||||||
|
export PS2="${cyan}>${no_color} "
|
||||||
|
# Debugging Prompt: "# " in blue
|
||||||
|
export PS4="${blue}#${no_color} "
|
||||||
|
|
||||||
|
#{- HISTORY -}#
|
||||||
|
|
||||||
|
#shopt -s histappend
|
||||||
|
#export PROMPT_COMMAND="history -a; histroy -c; history -r; $PROMPT_COMMAND"
|
||||||
|
|
||||||
|
export HISTCONTROL="ignoreboth:erasedups"
|
||||||
|
shopt -s histappend
|
||||||
|
export PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
|
||||||
|
|
||||||
|
|
||||||
#{- SOURCING -}#
|
#{- SOURCING -}#
|
||||||
|
|
||||||
# Source aliases
|
# Source aliases
|
||||||
|
|||||||
24
sh/.profile
24
sh/.profile
@ -1,25 +1,5 @@
|
|||||||
#{- ~/.profile -}#
|
#{- ~/.profile -}#
|
||||||
|
|
||||||
#{- PROMPT -}#
|
|
||||||
|
|
||||||
magenta="\[\033[1;35m\]"
|
|
||||||
red="\[\033[1;31m\]"
|
|
||||||
no_color="\[\033[0m\]"
|
|
||||||
|
|
||||||
# Primary prompt: ($/# )
|
|
||||||
# Secondary prompt: (> )
|
|
||||||
# Primary prompt is magenta on local machines, red on remote hosts
|
|
||||||
case $(hostname) in
|
|
||||||
point|line|triangle|square|pentagon)
|
|
||||||
export PS1="${magenta}\$${no_color} "
|
|
||||||
export PS2="${red}>${no_color} "
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
export PS1="$red\$$no_color "
|
|
||||||
export PS2="$magenta>$no_color "
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#{- PATH -}#
|
#{- PATH -}#
|
||||||
|
|
||||||
# Prepend ~/.local/bin to the path and append the current directory to the path
|
# Prepend ~/.local/bin to the path and append the current directory to the path
|
||||||
@ -49,6 +29,6 @@ if [ -w "$HOME/.history/sh" ]; then
|
|||||||
fi
|
fi
|
||||||
touch "$HOME/.history/sh"
|
touch "$HOME/.history/sh"
|
||||||
fi
|
fi
|
||||||
|
export HISTSIZE=5000
|
||||||
export HISTFILE="$HOME/.history/sh"
|
export HISTFILE="$HOME/.history/sh"
|
||||||
export HISTSIZE=10000
|
export HISTFILESIZE=10000
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user