Browse Source

Significantly improve bash experience.

Taylor Bockman 5 years ago
parent
commit
f4dbfa75aa
  1. 8
      README.md
  2. 1
      dotfiles/bash/bash_profile
  3. 39
      dotfiles/bash/bashrc
  4. 0
      dotfiles/bash/linuxrc
  5. 12
      dotfiles/bash/macrc
  6. 14
      dotfiles/bashrc

8
README.md

@ -21,7 +21,13 @@ The directory structure is as follows:
## Terminal
After using zsh for a very long time I've gone back to bash. While it takes more work and I don't have as many conveniences I am starting to appreciate
the simplicity of making the terminal available everywhere work for me.
the simplicity of making the terminal available everywhere work for me. `dotfiles/bash` contains all of my work on my bash terminal setup.
For OS X, symlink `scripts/dotfiles/bash/macrc` to `~/.macrc`.
For Linux, symlink `scripts/dotfiles/bash/linuxrc` to `~/.linuxrc`.
If you want better tab completion install `bash-completion` using your package manager.
## Vim

1
dotfiles/bash_profile → dotfiles/bash/bash_profile

@ -7,6 +7,7 @@ echo ".bash_private loaded"
export CC=$(which clang)
export CXX=$(which clang++)
export OPENSSL_ROOT_DIR=$(which openssl)
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

39
dotfiles/bash/bashrc

@ -0,0 +1,39 @@
# Use the iterm2 material theme in the root directory of the essentials repository. For linux,
# you will need to source a material theme color scheme for your terminal.
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -f ~/.macrc ]; then
source ~/.macrc
fi
fi
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# If you ever needed weather...
weather() {
curl wttr.in
}
# Test for the `bash-completion` package. Installing this adds better tab completion to bash.
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
# Ignore duplicates in history to make history less of a hassle to use.
export HISTCONTROL=ignoredups
# Better color handling so scrolling doesn't get broken.
# Note for Cygwin you need ncurses for this to work.
reset=$(tput sgr0)
green=$(tput setaf 2)
blue=$(tput setaf 4)
white=$(tput setaf 7)
bold=$(tput bold || tput md)
export PROMPT_DIRTRIM=2
# Important note for PS1 modification - everything non-printable must be escaped with `\[` and `\]`. Otherwise readline
# fails to track the prompt right and things get messed up when you input long strings.
export PS1=\
'\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]>\[$reset\] '

0
dotfiles/bash/linuxrc

12
dotfiles/bash/macrc

@ -0,0 +1,12 @@
# Directory colors - note OS X does not use coreutils so dircolors doesn't work.
export CLICOLOR=YES
# Custom directory colors
# Ex = Directory color - Bold blue, normal background (to match the $PS1 line)
# bx = Symlink color - Red, normal background
# Cx = Socket color - Bold green, normal background
# dx = Pipe color - Default
# Gx = Executable color - bold cyan
# The rest are default colors taken from `man ls`
export LSCOLORS="ExbxCxdxGxegedabagacad"

14
dotfiles/bashrc

@ -1,14 +0,0 @@
# Use the iterm2 material theme in the root directory of the essentials repository. For linux,
# you will need to source a material theme color scheme for your terminal.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# If you ever needed weather...
weather() {
curl wttr.in
}
export PROMPT_DIRTRIM=2
export PS1="\e[1;37m\u@\h\e[m: \e[1;34m\w\e[m \e[1;32m\[$(parse_git_branch)\]\e[m> "
Loading…
Cancel
Save