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.

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