diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/alias.bash | 9 | ||||
-rw-r--r-- | bash/color.bash | 44 | ||||
-rw-r--r-- | bash/env.profile | 3 | ||||
-rw-r--r-- | bash/git.bash | 8 | ||||
-rw-r--r-- | bash/prompt.bash | 12 |
5 files changed, 76 insertions, 0 deletions
diff --git a/bash/alias.bash b/bash/alias.bash new file mode 100644 index 0000000..c655059 --- /dev/null +++ b/bash/alias.bash @@ -0,0 +1,9 @@ +# vi:syntax=sh + +alias ls="ls --color" +alias la="ls -a" +alias ll="ls -lh" + +alias vim="nvim" + +alias ssh="TERM=xterm-color ssh" diff --git a/bash/color.bash b/bash/color.bash new file mode 100644 index 0000000..9bc93c6 --- /dev/null +++ b/bash/color.bash @@ -0,0 +1,44 @@ +# vi:syntax=sh + +black="\[\e[0;30m\]" +red="\[\e[0;31m\]" +green="\[\e[0;32m\]" +yellow="\[\e[0;33m\]" +blue="\[\e[0;34m\]" +purple="\[\e[0;35m\]" +cyan="\[\e[0;36m\]" +white="\[\e[0;37m\]" +orange="\[\e[0;91m\]" + +bold_black="\[\e[30;1m\]" +bold_red="\[\e[31;1m\]" +bold_green="\[\e[32;1m\]" +bold_yellow="\[\e[33;1m\]" +bold_blue="\[\e[34;1m\]" +bold_purple="\[\e[35;1m\]" +bold_cyan="\[\e[36;1m\]" +bold_white="\[\e[37;1m\]" +bold_orange="\[\e[91;1m\]" + +underline_black="\[\e[30;4m\]" +underline_red="\[\e[31;4m\]" +underline_green="\[\e[32;4m\]" +underline_yellow="\[\e[33;4m\]" +underline_blue="\[\e[34;4m\]" +underline_purple="\[\e[35;4m\]" +underline_cyan="\[\e[36;4m\]" +underline_white="\[\e[37;4m\]" +underline_orange="\[\e[91;4m\]" + +background_black="\[\e[40m\]" +background_red="\[\e[41m\]" +background_green="\[\e[42m\]" +background_yellow="\[\e[43m\]" +background_blue="\[\e[44m\]" +background_purple="\[\e[45m\]" +background_cyan="\[\e[46m\]" +background_white="\[\e[47;1m\]" +background_orange="\[\e[101m\]" + +normal="\[\e[0m\]" +reset_color="\[\e[39m\]" diff --git a/bash/env.profile b/bash/env.profile new file mode 100644 index 0000000..52c1a21 --- /dev/null +++ b/bash/env.profile @@ -0,0 +1,3 @@ +# vi:syntax=sh + +export EDITOR=vim diff --git a/bash/git.bash b/bash/git.bash new file mode 100644 index 0000000..365eac2 --- /dev/null +++ b/bash/git.bash @@ -0,0 +1,8 @@ +# vi:syntax=sh + +function get_git_state () { + local GIT_STATUS=$(git status -bs) + local GIT_BRANCH=$(echo $GIT_STATUS | grep "^## :") + local GIT_CHANGED=$(echo $GIT_STATUS | grep -c "^ M") + local GIT_UNTRACKED=$(echo $GIT_STATUS | grep -c "^??") +} diff --git a/bash/prompt.bash b/bash/prompt.bash new file mode 100644 index 0000000..2510ea5 --- /dev/null +++ b/bash/prompt.bash @@ -0,0 +1,12 @@ +# vi:syntax=sh + +function prompt_command () { + local EXIT="$?" + if [ $EXIT -eq 0 ]; then + EXIT="" + fi + #PS1="\n${cyan}\h:$(virtualenv_prompt) ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${red}${EXIT} ${reset_color}→ " + PS1="\n${cyan}\h: ${reset_color} ${yellow}\w \n${red}${EXIT} ${reset_color}→ " +} + +PROMPT_COMMAND=prompt_command |