summaryrefslogtreecommitdiff
path: root/.bashrc
blob: ee507e885cafd417a5722b62554407c52b24a625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
if [[ $- != *i* ]] ; then
# Shell is non-interactive.  Be done now! 
return
fi
 
export LC_ALL=en_US.UTF-8
alias clr="echo -ne '\033c'"
alias mv="mv -i"
alias cp="cp -i"
export history_control=ignoreboth
export command_oriented_history
export HISTIGNORE='&:[bf]g:exit:ls'
 
export LESSCOLORIZER='pygmentize -O bg=dark,style=github-dark -f terminal16m'
 
shopt -s extglob
shopt -s cmdhist
shopt -s histappend
shopt -s no_empty_cmd_completion
shopt -s checkwinsize
 
eval "$(dircolors -b)"
 
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
 
function xtitle() {
    case $TERM in
        xterm*|rxvt*|Eterm|eterm|alacritty)
            echo -ne "\e]0;$1\007"
            ;;
        screen)
            echo -ne "\e_$1\e\\"
            ;;
    esac
}
 
function starship_set_win_title() {
    local cwd="${PWD/$HOME/\~}"
    cwd="${cwd##[/~]*/}/"
 
    xtitle "$USER@$(hostname):$cwd"
}
starship_precmd_user_func=starship_set_win_title
eval "$(starship init bash)"