Skip to content

Instantly share code, notes, and snippets.

@pedrominicz
Last active May 15, 2023 20:05
Show Gist options
  • Save pedrominicz/80ad6d51497c2c158ea397f6892a414f to your computer and use it in GitHub Desktop.
Save pedrominicz/80ad6d51497c2c158ea397f6892a414f to your computer and use it in GitHub Desktop.
Minimal Bash config with infinite command history and better autocomplete settings.
#
# ~/.bashrc
#
# If not running interactively, don't do anything.
[[ $- != *i* ]] && return
shopt -s histappend
HISTSIZE=''
HISTFILESIZE=''
# Change history file location because certain bash sessions truncate
# `.bash_history`.
HISTFILE="$HOME/.history_bash"
HISTCONTROL='ignoreboth'
bind 'set completion-ignore-case on'
bind 'set show-all-if-ambiguous on'
PS1='$(basename "$PWD" |head -c1)\$ '
if command -v nvim &>/dev/null; then
export VISUAL='nvim'
export EDITOR='nvim'
export MANPAGER="nvim '+Man!'"
else
export VISUAL='vi'
export EDITOR='vi'
fi
alias es="exec $SHELL"
alias cp='cp -i'
alias mv='mv -i'
# Only highlight matches.
export GREP_COLORS='ms=01;31:mc=01;31:sl=:cx=:fn=:ln=:bn=:se='
alias grep='grep --color=auto'
alias mpv='mpv --hr-seek=yes'
export RLWRAP_HOME="$HOME/.local/share/rlwrap"
hide() (
set -e
for file in "$@"; do
mv -i {,.}"$file"
echo mv {,.}"$file"
done
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment