clean up bash config
parent
1074406b66
commit
aabb888752
@ -1,43 +1,41 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# append to the history file, don't overwrite it
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# Disable capslock
|
# Disable capslock
|
||||||
if [[ -x `which setxkbmap` ]]; then
|
if [[ -x $(which setxkbmap) ]]; then
|
||||||
if [[ `uname` == 'Linux' ]]; then
|
if [[ $(uname) == Linux ]]; then
|
||||||
setxkbmap -option ctrl:nocaps
|
setxkbmap -option ctrl:nocaps
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
||||||
|
export EDITOR='vim'
|
||||||
|
|
||||||
# don't put duplicate lines in the history. See bash(1) for more options
|
# don't put duplicate lines in the history. See bash(1) for more options
|
||||||
# ... or force ignoredups and ignorespace
|
# ... or force ignoredups and ignorespace
|
||||||
export HISTCONTROL=ignoredups:erasedups:ignorespace
|
export HISTCONTROL=ignoredups:erasedups:ignorespace
|
||||||
|
|
||||||
# append to the history file, don't overwrite it
|
|
||||||
shopt -s histappend
|
|
||||||
|
|
||||||
# Use empty string for unlimited history
|
# Use empty string for unlimited history
|
||||||
export HISTSIZE=
|
export HISTSIZE=
|
||||||
export HISTFILESIZE=
|
export HISTFILESIZE=
|
||||||
export HISTTIMEFORMAT='%y-%m-%d %T λ '
|
export HISTTIMEFORMAT='%y-%m-%d %T λ '
|
||||||
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
|
||||||
|
|
||||||
# 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)
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
if [ "$TERM" == "xterm" ]; then
|
# enable color support of ls and also add handy aliases
|
||||||
export TERM=xterm-256color
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(uname) == 'Darwin' ]]; then
|
if [ "$TERM" == xterm ]; then
|
||||||
export BS_OS='osx'
|
export TERM=xterm-256color
|
||||||
elif [[ $(uname) == 'Linux' ]]; then
|
|
||||||
export BS_OS='linux'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export EDITOR='vim'
|
|
||||||
|
|
||||||
[[ -f ~/.nvm/nvm.sh ]] && source ~/.nvm/nvm.sh
|
[[ -f ~/.nvm/nvm.sh ]] && source ~/.nvm/nvm.sh
|
||||||
[[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion
|
[[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion
|
||||||
|
@ -1,53 +1,21 @@
|
|||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
if [ -f ~/.bash/environment ]; then
|
function source-file {
|
||||||
source ~/.bash/environment
|
file="$1"
|
||||||
fi
|
if [[ -f "$file" ]]; then
|
||||||
|
. "$file"
|
||||||
if [ -f ~/.bash/path ]; then
|
fi
|
||||||
source ~/.bash/path
|
}
|
||||||
fi
|
|
||||||
|
source-file /etc/bash_completion
|
||||||
if [ -f ~/.bash/colors ]; then
|
source-file ~/.bash/colors
|
||||||
source ~/.bash/colors
|
source-file ~/.bash/aliases
|
||||||
fi
|
source-file ~/.bash/functions
|
||||||
|
source-file ~/.bash/git-flow-completion
|
||||||
if [ -f ~/.bash/functions ]; then
|
source-file ~/.bash/path
|
||||||
source ~/.bash/functions
|
source-file ~/.bash/environment
|
||||||
fi
|
source-file ~/.bash/prompt
|
||||||
|
source-file ~/opt/bash/env
|
||||||
if [ -f ~/.bash/aliases ]; then
|
|
||||||
source ~/.bash/aliases
|
unset -f source-file
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/.bash/git-flow-completion ]; then
|
|
||||||
source ~/.bash/git-flow-completion
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/opt/bash/env ]; then
|
|
||||||
source ~/opt/bash/env
|
|
||||||
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
|
|
||||||
source /etc/bash_completion
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
|
|
||||||
source /opt/local/etc/profile.d/bash_completion.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/bashrc ]; then
|
|
||||||
source /etc/bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/.bash/prompt ]; then
|
|
||||||
source ~/.bash/prompt
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/.bash/direnv-hook ]; then
|
|
||||||
source ~/.bash/direnv-hook
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue