twodogsdave

.bashrc

May 31st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  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. EDITOR=nano
  5. export EDITOR
  6.  
  7. # If not running interactively, don't do anything
  8. case $- in
  9. *i*) ;;
  10. *) return;;
  11. esac
  12.  
  13. # don't put duplicate lines or lines starting with space in the history.
  14. # See bash(1) for more options
  15. HISTCONTROL=ignoreboth
  16.  
  17. # append to the history file, don't overwrite it
  18. shopt -s histappend
  19.  
  20. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  21. HISTSIZE=10000
  22. HISTFILESIZE=${HISTSIZE}
  23.  
  24. # check the window size after each command and, if necessary,
  25. # update the values of LINES and COLUMNS.
  26. shopt -s checkwinsize
  27.  
  28. # If set, the pattern "**" used in a pathname expansion context will
  29. # match all files and zero or more directories and subdirectories.
  30. #shopt -s globstar
  31.  
  32. # make less more friendly for non-text input files, see lesspipe(1)
  33. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  34.  
  35. # set variable identifying the chroot you work in (used in the prompt below)
  36. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  37. debian_chroot=$(cat /etc/debian_chroot)
  38. fi
  39.  
  40. # If this is an xterm set the title to user@host:dir
  41. case "$TERM" in
  42. xterm*|rxvt*)
  43. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \w\a\]$PS1"
  44. ;;
  45. *)
  46. ;;
  47. esac
  48.  
  49. # enable color support of ls and also add handy aliases
  50. if [ -x /usr/bin/dircolors ]; then
  51. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  52. fi
  53.  
  54. # color man pages
  55. function man() {
  56. env LESS_TERMCAP_mb=$'\E[01;31m' \
  57. LESS_TERMCAP_md=$'\E[01;38;5;74m' \
  58. LESS_TERMCAP_me=$'\E[0m' \
  59. LESS_TERMCAP_se=$'\E[0m' \
  60. LESS_TERMCAP_so=$'\E[38;5;246m' \
  61. LESS_TERMCAP_ue=$'\E[0m' \
  62. LESS_TERMCAP_us=$'\E[04;38;5;146m' \
  63. man "$@"
  64. }
  65.  
  66. # prompt
  67. # PS1='[\W]\$ '
  68. # PS1='[\u@\h \W]\$ '
  69. # PS1="\[\e[0;1m\]┌─[ \[\e[32;1m\]\u\[\e[0;1m\] ]──[ \[\e[32;1m\]\w\[\e[0;1m\] ]\n└──> \[\e[0m\]"
  70. # PS1='\[\e[40m\]\[\e[1;37m\] \u \[\e[47m\]\[\e[1;30m\] \w \[\e[0m\]\[\e[1;30m\]\[\e[42m\] > \[\e[0m\] ' #regular user
  71. # PS1='\[\e[41m\]\[\e[1;37m\] \u \[\e[47m\]\[\e[1;30m\] \w \[\e[0m\]\[\e[1;30m\]\[\e[42m\] > \[\e[0m\] ' #root user
  72. # PS1='\[\e[1;30m\][\[\e[0;33m\]\u@\H\[\e[1;30m\]]─╸\[\e[1;30m\][\[\e[37m\]\W\[\e[1;30m\]]\[\e[1;34m\]\[\e[0m\]\[\e[m \] '
  73. PS1="\[\e[1;30m\]┌─[ \[\e[32;1m\]\w\[\e[1;30m\] ]\n\e[1;30m\]└──╸ \[\e[0m\]"
  74.  
  75. # some usefull aliases
  76. alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
  77. alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
  78. alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
  79. alias grep='grep --color=tty -d skip'
  80. alias cp="cp -i" # confirm before overwriting something
  81. alias df='df -h' # human-readable sizes
  82. alias free='free -m' # show sizes in MB
  83.  
  84. # Alias definitions.
  85. # You may want to put all your additions into a separate file like
  86. # ~/.bash_aliases, instead of adding them here directly.
  87. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  88.  
  89. if [ -f ~/.arch_aliases ]; then
  90. . ~/.arch_aliases
  91. fi
  92.  
  93. if [ -d "$HOME/bin" ] ; then
  94. PATH="$HOME/bin:$PATH"
  95. fi
  96.  
  97. # enable programmable completion features (you don't need to enable
  98. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  99. # sources /etc/bash.bashrc).
  100. if ! shopt -oq posix; then
  101. if [ -f /usr/share/bash-completion/bash_completion ]; then
  102. . /usr/share/bash-completion/bash_completion
  103. elif [ -f /etc/bash_completion ]; then
  104. . /etc/bash_completion
  105. fi
  106. fi
Advertisement
Add Comment
Please, Sign In to add comment