Last active
August 29, 2018 14:26
-
-
Save epcim/fb81a2b2b9af41df7f17059af8b953be to your computer and use it in GitHub Desktop.
shell bash simple environment profile env bashrc shellrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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