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.

107 lines
3.2 KiB

4 years ago
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4. # If not running interactively, don't do anything
  5. case $- in
  6. *i*) ;;
  7. *) return;;
  8. esac
  9. export PATH=$PATH:~/src/sneak/tools/scripts
  10. export EDITOR=vim
  11. # Weird LS_COLORS to deal with weird file permissions in Windows filesystems.
  12. export LS_COLORS="di=1;34:ln=1;36:so=32:pi=33:ex=0:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=1;34"
  13. umask 022
  14. # don't put duplicate lines or lines starting with space in the history.
  15. # See bash(1) for more options
  16. HISTCONTROL=ignoreboth
  17. # append to the history file, don't overwrite it
  18. shopt -s histappend
  19. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  20. HISTSIZE=1000
  21. HISTFILESIZE=2000
  22. # check the window size after each command and, if necessary,
  23. # update the values of LINES and COLUMNS.
  24. shopt -s checkwinsize
  25. # If set, the pattern "**" used in a pathname expansion context will
  26. # match all files and zero or more directories and subdirectories.
  27. shopt -s globstar
  28. # make less more friendly for non-text input files, see lesspipe(1)
  29. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  30. # set variable identifying the chroot you work in (used in the prompt below)
  31. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  32. debian_chroot=$(cat /etc/debian_chroot)
  33. fi
  34. # set a fancy prompt (non-color, unless we know we "want" color)
  35. case "$TERM" in
  36. xterm-color|*-256color) color_prompt=yes;;
  37. esac
  38. # uncomment for a colored prompt, if the terminal has the capability; turned
  39. # off by default to not distract the user: the focus in a terminal window
  40. # should be on the output of commands, not on the prompt
  41. #force_color_prompt=yes
  42. if [ -n "$force_color_prompt" ]; then
  43. if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  44. # We have color support; assume it's compliant with Ecma-48
  45. # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  46. # a case would tend to support setf rather than setaf.)
  47. color_prompt=yes
  48. else
  49. color_prompt=
  50. fi
  51. fi
  52. PS1='\u@\h \w\n'
  53. if [ "$color_prompt" = yes ]; then
  54. PS1='\[\033[01;44m\]$(printf "%*s" $(($(tput cols)-9)) "")$(date +%H:%M:%S) \r\u@\h \w\[\033[00m\]\n'
  55. fi
  56. unset color_prompt force_color_prompt
  57. # If this is an xterm set the title to user@host:dir
  58. case "$TERM" in
  59. xterm*|rxvt*)
  60. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  61. ;;
  62. *)
  63. ;;
  64. esac
  65. # Alias definitions.
  66. # You may want to put all your additions into a separate file like
  67. # ~/.bash_aliases, instead of adding them here directly.
  68. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  69. alias ..='cd ..'
  70. alias ls='ls --color=auto'
  71. alias fstype='find . -maxdepth 0 -printf "%F\n"'
  72. # Redefine "cd" to automatically "ls" afterward.
  73. function cd () { builtin cd "$@" && ls; }
  74. # enable programmable completion features (you don't need to enable
  75. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  76. # sources /etc/bash.bashrc).
  77. if ! shopt -oq posix; then
  78. if [ -f /usr/share/bash-completion/bash_completion ]; then
  79. . /usr/share/bash-completion/bash_completion
  80. elif [ -f /etc/bash_completion ]; then
  81. . /etc/bash_completion
  82. fi
  83. fi