Update .bashrc
[dotfiles/.git] / .bashrc
1 # ~/.bashrc: executed by bash(1) for non-login shells.
2 # If not running interactively, don't do anything
3 case $- in
4     *i*) ;;
5       *) return;;
6 esac
7 #Import all of the subfiles for .bashrc
8
9 if [ -f ~/.config/bashrc/alias ];
10 then
11     . ~/.config/bashrc/alias
12 fi
13
14 if [ -f ~/.config/bashrc/promts ];
15 then
16     . ~/.config/bashrc/promts
17 fi
18
19 if [ -f ~/.config/bashrc/titles ];
20 then
21     . ~/.config/bashrc/titles
22 fi
23
24 if [ -f ~/.config/bashrc/exports ];
25 then
26     . ~/.config/bashrc/exports
27 fi
28
29 if [ -f ~/.config/bashrc/functions ];
30 then
31     . ~/.config/bashrc/functions
32 fi
33
34
35
36 #########################################AUTOCOMPLETION#####################
37 # sources /etc/bash.bashrc).
38 if [ -f /usr/share/fzf/completion.bash ];
39 then
40 source /usr/share/fzf/completion.bash
41 fi
42
43 if [ -f /usr/share/fzf/completion.bash ];
44 then
45 source /usr/share/fzf/key-bindings.bash
46 fi
47 # autocomplete for sudo man and wich
48 complete -cf sudo man wich;
49 #For arch
50 if ! shopt -oq posix; then
51   if [ -f /usr/share/bash-completion/bash_completion ]; then
52     . /usr/share/bash-completion/bash_completion
53   elif [ -f /etc/bash_completion ]; then
54     . /etc/bash_completion
55   fi
56 fi
57
58 ###########################################################################
59
60 ####################################HISTORY MANAGEMENT#####################
61 # don't put duplicate lines or lines starting with space in the history.
62 HISTCONTROL=ignoreboth
63 # append to the history file, don't overwrite it
64 shopt -s histappend
65 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
66 HISTSIZE=
67 HISTFILESIZE=
68 export HISTIGNORE='&:ls:ll:la:cd:exit:clear:history'
69 ###########################################################################
70
71
72
73 # check the window size after each command and, if necessary,
74 # update the values of LINES and COLUMNS.
75 shopt -s checkwinsize
76
77 # make less more friendly for non-text input files, see lesspipe(1)
78 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
79 # vi mode in the shell
80 set -o vi
81
82 #####adding the agent forwarding stuff
83 if [ -z "$SSH_AUTH_SOCK" ] ; then
84     eval `ssh-agent` > /dev/null 2&>1;
85     ssh-add > /dev/null 2&>1;
86
87 fi
88
89
90 source /usr/share/bash-completion/bash_completion
91 bind 'set show-all-if-ambiguous on';
92 bind 'TAB:menu-complete';