# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# Set autocomplete
bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'

# Set auto cd 
shopt -s autocd

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.npm/bin:$PATH"

EDITOR=/usr/bin/nvim
SUDO_EDITOR=/usr/bin/nvim
VISUAL=/usr/bin/nvim

alias lz="lazygit"
alias vi="nvim"
alias vim="nvim"
alias ls="eza -1 -l --icons=auto --git-repos --git -h -g -o --no-permissions"
alias lsa="eza -1 -l --icons=auto --git-repos --git -h -g -o --no-permissions -a"
alias lss="eza -1 -l --icons=auto --git-repos --git -h -g --total-size -o --no-permissions -a"

source ~/.fzf.bash
eval "$(starship init bash)"

if [[ $TERM =~ linux ]]; then
    wrappedhl
fi
