Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8 KiB

13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
  1. # Common path, aliases etc. for both shells I actually use:
  2. source ~/.sh_common
  3. export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
  4. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
  5. # Don't put duplicate lines in the history. See bash(1) for more options:
  6. export HISTCONTROL=ignoredups
  7. export HISTSIZE=-1
  8. export HISTFILESIZE=-1
  9. export HISTFILE=~/.histfile
  10. # Append to the history file, don't overwrite it:
  11. shopt -s histappend
  12. PROMPT_COMMAND="history -a; history -n; $PROMPT_COMMAND"
  13. # Check the window size after each command and, if necessary,
  14. # update the values of LINES and COLUMNS:
  15. shopt -s checkwinsize
  16. # Change to a directory with just its name:
  17. shopt -s autocd
  18. # Ideally we want to use this prompt:
  19. #
  20. # user@host hh:mm:ss cwd (git branch) $
  21. #
  22. # In xterms, we also set the window title to cwd.
  23. # Ansi color escape sequences:
  24. prompt_black='\[\e[30m\]'
  25. prompt_red='\[\e[31m\]'
  26. prompt_green='\[\e[32m\]'
  27. prompt_yellow='\[\e[33m\]'
  28. prompt_blue='\[\e[34m\]'
  29. prompt_magenta='\[\e[35m\]'
  30. prompt_cyan='\[\e[36m\]'
  31. prompt_white='\[\e[37m\]'
  32. prompt_default_color='\[\e[0m\]'
  33. # Pieces of the prompt:
  34. prompt_xtitle='\[\e]0;\w\a\]'
  35. prompt_userhost=$prompt_blue'\u@\h'
  36. prompt_cwd=$prompt_yellow'\w'
  37. prompt_time=$prompt_cyan'\t'
  38. prompt_go=$prompt_default_color'$ '
  39. prompt_nocolor='\n\u@\h \w\n$ '
  40. prompt_timeless='\n'$prompt_userhost' '$prompt_cwd'\n'$prompt_go
  41. prompt_full='\n[bash] '$prompt_userhost' '$prompt_time' '$prompt_cwd' $(parse_git_branch) '$prompt_go
  42. prompt_xterm="$prompt_xtitle""$prompt_full"
  43. # Select prompt based on terminal variable:
  44. case $TERM in
  45. xterm*|rxvt|screen*|cygwin)
  46. export PS1=$prompt_xterm ;;
  47. linux*|*vt100*|cons25)
  48. export PS1=$prompt_full ;;
  49. *)
  50. export PS1=$prompt_nocolor ;;
  51. esac
  52. [ -f ~/.fzf.bash ] && source ~/.fzf.bash
  53. eval $(rash init)