Update fzf location
[dotfiles] / .bashrc
1 #!/bin/sh
2
3 # ~/.bashrc: executed by bash(1) for non-login shells.
4 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
5 # for examples
6
7 # python setup.py --command-packages=stdeb.command sdist_dsc
8
9 # dns servers 80.67.169.12 || 2001:910:800::12
10 # 31.14.133.188 (ns5.it) -- 99.30% uptime
11 # 87.98.242.252 (ns11.fr) -- 99.58% uptime
12 # 87.98.175.85 (ns10.fr) -- 99.61% uptime
13 # 193.183.98.154 (ns1.it) -- 99.84% uptime
14
15 # freenom
16 # 80.80.80.80
17 # 80.80.81.81
18
19 # unicode characters https://en.wikipedia.org/wiki/List_of_Unicode_characters
20
21 # make less more friendly for non-text input files, see lesspipe(1)
22 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
23
24
25 # If not running interactively, don't do anything
26 case $- in
27 *i*) ;;
28 *) return;;
29 esac
30
31 # make less more friendly for non-text input files, see lesspipe(1)
32 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
33
34 # set variable identifying the chroot you work in (used in the prompt below)
35 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
36 debian_chroot=$(cat /etc/debian_chroot)
37 fi
38
39
40 # enable color support of ls and also add handy aliases
41 if [ -x /usr/bin/dircolors ]; then
42 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
43 alias ls='ls --color=auto'
44 #alias dir='dir --color=auto'
45 #alias vdir='vdir --color=auto'
46
47 alias grep='grep --color=auto'
48 alias fgrep='fgrep --color=auto'
49 alias egrep='egrep --color=auto'
50 fi
51
52 # colored GCC warnings and errors
53 #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
54
55 # some more ls aliases
56 alias ll='ls -alF'
57 alias la='ls -A'
58 alias l='ls -CF'
59
60 # Add an "alert" alias for long running commands. Use like so:
61 # sleep 10; alert
62 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$//'\'')"'
63
64 # Alias definitions.
65 # You may want to put all your additions into a separate file like
66 # ~/.bash_aliases, instead of adding them here directly.
67 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
68
69 if [ -f ~/.bash_aliases ]; then
70 . ~/.bash_aliases
71 fi
72
73 # enable programmable completion features (you don't need to enable
74 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
75 # sources /etc/bash.bashrc).
76 if ! shopt -oq posix; then
77 if [ -f /usr/share/bash-completion/bash_completion ]; then
78 . /usr/share/bash-completion/bash_completion
79 elif [ -f /etc/bash_completion ]; then
80 . /etc/bash_completion
81 fi
82 fi
83
84 # start gpg agent
85 # be sure to have done apt install gpg-agent pinentry-curses first
86 if ! ps -U "$USER" -o pid,ucomm | grep -i "gpg-agent" > /dev/null; then
87 echo "gpg agent not running, starting new one";
88 eval `gpg-agent --daemon`
89 fi
90
91 # just for being able to source easily
92 CURRENT_WORKING_DIR="$HOME/mydotfiles"
93
94 # print available tmux sessions if available
95 tmux list-sessions 2> /dev/null
96
97 # Alias definitions.
98 # You may want to put all your additions into a separate file like
99 # ~/.bash_aliases, instead of adding them here directly.
100 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
101 [[ -f "$CURRENT_WORKING_DIR"/.bash_aliases ]] && . "$CURRENT_WORKING_DIR"/.bash_aliases
102
103 # git completion
104 [[ -f "$CURRENT_WORKING_DIR"/.git_completion ]] && . "$CURRENT_WORKING_DIR"/.git_completion
105
106 # prompt
107 [[ -f "$CURRENT_WORKING_DIR"/.bash_prompts ]] && . "$CURRENT_WORKING_DIR"/.bash_prompts
108
109 # personal customization
110 [[ -f "$CURRENT_WORKING_DIR"/.bash_customization ]] && . "$CURRENT_WORKING_DIR"/.bash_customization
111
112 # personal functions
113 [[ -f "$CURRENT_WORKING_DIR"/.bash_function ]] && . "$CURRENT_WORKING_DIR"/.bash_function
114
115 # personal export
116 [[ -f "$CURRENT_WORKING_DIR"/.bash_export ]] && . "$CURRENT_WORKING_DIR"/.bash_export
117
118 # personal color
119 [[ -f "$CURRENT_WORKING_DIR"/.bash_color ]] && . "$CURRENT_WORKING_DIR"/.bash_color
120
121 # personal shopt
122 [[ -f "$CURRENT_WORKING_DIR"/.bash_shopt ]] && . "$CURRENT_WORKING_DIR"/.bash_shopt
123
124 # git completion
125 [[ -f "$CURRENT_WORKING_DIR"/.git_completion ]] && . "$CURRENT_WORKING_DIR"/.git_completion
126
127 # is or is not
128 [[ -f "$CURRENT_WORKING_DIR"/.bash_is ]] && . "$CURRENT_WORKING_DIR"/.bash_is
129
130 # jump to directories
131 [[ -f "$CURRENT_WORKING_DIR"/.bash_marks ]] && . "$CURRENT_WORKING_DIR"/.bash_marks
132
133 # tmux completion script
134 [[ -f "$CURRENT_WORKING_DIR"/.bash_tmux ]] && . "$CURRENT_WORKING_DIR"/.bash_tmux
135
136 # jump completion script
137 [[ -f "$CURRENT_WORKING_DIR"/.bash_compl ]] && . "$CURRENT_WORKING_DIR"/.bash_compl
138
139 # jump completion script
140 [[ -f "$CURRENT_WORKING_DIR"/.bash_base64 ]] && . "$CURRENT_WORKING_DIR"/.bash_base64
141
142 # emacs launcher script
143 [[ -f "$CURRENT_WORKING_DIR"/.bash_emacs ]] && . "$CURRENT_WORKING_DIR"/.bash_emacs
144
145 # memo
146 [[ -f "$CURRENT_WORKING_DIR"/.bash_memo ]] && . "$CURRENT_WORKING_DIR"/.bash_memo
147
148 # custom bindings
149 [[ -f "$CURRENT_WORKING_DIR"/.bash_bind ]] && . "$CURRENT_WORKING_DIR"/.bash_bind
150
151 # custom filters
152 [[ -f "$CURRENT_WORKING_DIR"/.bash_filters ]] && . "$CURRENT_WORKING_DIR"/.bash_filters
153
154 # openssl
155 [[ -f "$CURRENT_WORKING_DIR"/.bash_openssl ]] && . "$CURRENT_WORKING_DIR"/.bash_openssl
156
157 # pomodoro
158 [[ -f "$CURRENT_WORKING_DIR"/.bash_pomodoro ]] && . "$CURRENT_WORKING_DIR"/.bash_pomodoro
159
160 # django
161 [[ -f "$CURRENT_WORKING_DIR"/.bash_django ]] && . "$CURRENT_WORKING_DIR"/.bash_django
162
163 # nginx
164 [[ -f "$CURRENT_WORKING_DIR"/.bash_nginx ]] && . "$CURRENT_WORKING_DIR"/.bash_nginx
165
166 # docker
167 [[ -f "$CURRENT_WORKING_DIR"/.bash_docker ]] && . "$CURRENT_WORKING_DIR"/.bash_docker
168
169 # fzf, fuzzy finder
170 [[ -f "$CURRENT_WORKING_DIR"/.fzf.bash ]] && source "$CURRENT_WORKING_DIR"/.fzf.bash