alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores'
alias rg='rg --path-separator="//"'
alias githome='git --git-dir=$HOME/.githome --work-tree=$HOME'
+alias gh='githome'
if [ ! -x "$(which tree 2>/dev/null)" ]
then
# Add tab completion for `githome` by marking it as an alias for `git`
-_completion_loader git
+_completion_loader git 2> /dev/null
if type _git &>/dev/null; then
complete -o "default" -o "nospace" -F _git githome;
+ complete -o "default" -o "nospace" -F _git gh;
fi;
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
cd ~
+# options
set -o vi
-
-# Set unlimited history
-HISTFILESIZE=
-HISTSIZE=
-HISTCONTROL=ignoreboth:erasedups
-HISTTIMEFORMAT="[%F %T] "
-HISTFILE=~/.bash_history.local
-
-# Use 'help shopt' to see the documentation for the given options
shopt -s autocd
shopt -s cdspell
shopt -s checkwinsize
shopt -s no_empty_cmd_completion
shopt -s nocaseglob
-# Set prompt
+# prompt
PS1='\[\033]0;${USERNAME}@${HOSTNAME}:${PWD}\007\]' # terminal title
if [[ -z "$MSYS2_PS1" ]]; then
PS1="$PS1"'${debian_chroot:+($debian_chroot)}' # debian
fi
-PS1="$PS1"'\[\033]0;${USER}@${HOSTNAME}:${PWD}\007\]' # terminal title
PS1="$PS1"'\[\033[01;32m\]' # change color
PS1="$PS1"'\u@\h' # user@host
PS1="$PS1"'\[\033[00m\]' # change color
GIT_PS1_HIDE_IF_PWD_IGNORED=1
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
-# Load completion, aliases, and local settings
+
+# history
+HISTCONTROL=ignoreboth:erasedups
+HISTTIMEFORMAT="[%F %T] "
+HISTFILESIZE=
+HISTSIZE=
+HISTFILE=~/.bash_history.local
+
+# completion, aliases, and local settings
[ -f ~/.bash_aliases ] && . ~/.bash_aliases;
[ -f ~/.bash_completion ] && . ~/.bash_completion;
[ -f ~/.bashrc.local ] && . ~/.bashrc.local