-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bashrc
90 lines (70 loc) · 2.94 KB
/
.bashrc
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
export EDITOR="gvim -f"
# Keep a rich command line history: store 20,000 lines on disk, and keep 5,000
# lines in memory. Erase duplicates to save space.
export HISTSIZE=5000
export HISTFILESIZE=20000
export HISTCONTROL=erasedups
shopt -s histappend
# Don't match dotfiles with autocomplete
# (Unless, of course, you start by typing the dot)
bind 'set match-hidden-files off'
# Disable flow control, so that <C-Q> commands work in terminal vim.
stty -ixon
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# 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$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# If this is a non-interactive shell, we still want to get
# the stuff (like $PATH) in /etc/profile if we haven't already
if [[ -z "$Environ_Sourced" && -f /etc/profile ]]
then
source /etc/profile
fi
# Don't write the .pyc files; they just clutter up all my directories and make
# it harder to navigate in vim.
export PYTHONDONTWRITEBYTECODE=1
# ghar setup (for synchronizing homedir stuff).
export GHAR_DIR="$HOME/tools/ghar"
export PATH="$PATH:$GHAR_DIR/bin/"
. "$GHAR_DIR/ghar-bash-completion.sh"
# Tweak path to include executable locations.
export PATH="$PATH:$HOME/.local/bin/"
export PATH="$PATH:$HOME/local/bin"
export PATH="$PATH:$HOME/bin/"
# Fixes errors like this one:
# WARNING **: Unable to create Ubuntu Menu Proxy: Timeout was reached
alias gvim='UBUNTU_MENUPROXY= gvim'
[[ -f ~/.bash_prompt ]] && . ~/.bash_prompt
[[ -f ~/.bash_custom_settings ]] && . ~/.bash_custom_settings