Skip to content

Instantly share code, notes, and snippets.

@epcim
Last active August 29, 2018 14:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcim/fb81a2b2b9af41df7f17059af8b953be to your computer and use it in GitHub Desktop.
Save epcim/fb81a2b2b9af41df7f17059af8b953be to your computer and use it in GitHub Desktop.
shell bash simple environment profile env bashrc shellrc
# bash history
# echo 'shopt -s histappend' >> ~/.bashrc
# echo 'PROMPT_COMMAND="history -a;$PROMPT_COMMAND"' >> ~/.bashrc
# echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
export HISTTIMEFORMAT=
# paths
export PATH=$PATH:~/bin
# git
export GIT_COMMITTER_NAME="Petr Michalec"
export GIT_COMMITTER_EMAIL="pmichalec@mirantis.com"
export GIT_AUTHOR_NAME="Petr Michalec"
export GIT_AUTHOR_EMAIL="pmichalec@mirantis.com"
export SALT_OPTS="--state-output=changes -lerror"
# vim
set -o vi
#export vim="vim -u ~/.vimrc.disabled"
#alias vim="$vim"
alias vi=vim
# aliases
alias ack=ack-grep
#alias git="https_proxy=http://10.144.106.132:8678 git"
#git aliases
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias ge='git checkout '
alias gob='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '
alias get='git '
alias gl='git lg'
alias gh='git lg'
#test -e /usr/share/bash-completion/completions/salt-common || \
# curl -sL "https://raw.githubusercontent.com/saltstack/salt/develop/pkg/salt.bash" | sudo tee /usr/share/bash-completion/completions/salt-common
#test -e /usr/share/zsh/vendor-completions/_salt || \
# curl -sL "https://raw.githubusercontent.com/saltstack/salt/develop/pkg/zsh_completion.zsh" | sudo tee /usr/share/zsh/vendor-completions/_salt
# for bash
test -e /usr/share/bash-completion/completions/salt-common && \
source /usr/share/bash-completion/completions/salt-common
test -e /usr/bin/direnv && eval "$(direnv hook bash)"
# git branch to bash promt
grep git_branch ~/.bashrc > /dev/null || {
cat <<- 'EOF' >> ~/.bashrc
gb() {
echo -n '(' && git branch 2>/dev/null | grep '^*' | colrm 1 2 | tr -d '\n' && echo -n ')'
}
git_branch() {
gb | sed 's/()//'
}
export PS1="$PS1\$(git_branch)#"
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment