-
-
Save aquastripe/34f981b1a949133d9c3d7d88877c601b to your computer and use it in GitHub Desktop.
Color up your bash history with the date time information of called commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MY_BASH_BLUE="\033[0;34m" #Blue | |
MY_BASH_NOCOLOR="\033[0m" | |
HISTTIMEFORMAT=`echo -e ${MY_BASH_BLUE}[%F %T] $MY_BASH_NOCOLOR ` | |
HISTSIZE=20000 | |
HISTFILESIZE=20000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /etc/profile.d/conda.sh | |
# for .bash_history | |
MY_BASH_BLUE="\033[0;34m" | |
MY_BASH_CYAN="\e[1;36m" | |
MY_BASH_NOCOLOR="\033[0m" | |
HISTTIMEFORMAT=`echo -e ${MY_BASH_CYAN}[%F %T] $MY_BASH_NOCOLOR ` | |
alias a='conda activate' | |
alias d='conda deactivate' | |
alias n='nvidia-smi' | |
alias julab='jupyter-lab' | |
alias kderestart='kquitapp5 plasmashell || killall plasmashell && kstart5 plasmashell' | |
alias huserv='hugo server -D' | |
alias hunew='hugo new' | |
alias aap='~/Tools/set_headphone_profile_a2dp_sink.sh' | |
alias hlp='~/Tools/highlight-pointer/highlight-pointer -r 10 --released-color=#E03E3E --pressed-color=#F4DFEB' | |
alias sai='sudo apt install' | |
alias gitcl='git clone' | |
# HSTR configuration - add this to ~/.bashrc | |
alias hh=hstr # hh to be alias for hstr | |
export HSTR_CONFIG=hicolor # get more colors | |
shopt -s histappend # append new history items to .bash_history | |
export HISTCONTROL=ignorespace # leading space hides commands from history | |
export HISTFILESIZE=10000 # increase history file size (default is 500) | |
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500) | |
# ensure synchronization between bash memory and history file | |
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" | |
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc) | |
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi | |
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k | |
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment