🐧 One more repository with f*cking dot files...
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.

103 lines
2.1 KiB

  1. # .bashrc -- Samuel FORESTIER
  2. ##
  3. ## This file is unmaintained.
  4. ## See `.zshrc` instead.
  5. ##
  6. # Some HISTORY options
  7. shopt -s histappend
  8. HISTSIZE=1000
  9. HISTFILESIZE=2000
  10. HISTCONTROL=ignoredups
  11. # Check the window size after each command
  12. # If necessary, update the values of LINES and COLUMNS
  13. shopt -s checkwinsize
  14. # Match hidden files too with `*` wildcard
  15. shopt -s dotglob
  16. # Colors support for `ls`, `dir`-like and `grep`-like commands
  17. if [ -x /usr/bin/dircolors ]; then
  18. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  19. alias ls='ls --color=auto'
  20. alias dir='dir --color=auto'
  21. alias vdir='vdir --color=auto'
  22. alias grep='grep --color=auto'
  23. alias fgrep='fgrep --color=auto'
  24. alias egrep='egrep --color=auto'
  25. fi
  26. # Colored GCC warnings and errors (important !)
  27. export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  28. # BASH auto-completion
  29. if ! shopt -oq posix; then
  30. if [ -f /usr/share/bash-completion/bash_completion ]; then
  31. . /usr/share/bash-completion/bash_completion
  32. elif [ -f /etc/bash_completion ]; then
  33. . /etc/bash_completion
  34. fi
  35. fi
  36. # `ll` alias for `ls` !
  37. alias ll='ls -lAh'
  38. # Let's set a colorful prompt.
  39. PS1='\
  40. \[\033[00m\][\
  41. \[\033[31m\]\u\
  42. \[\033[00m\]@\
  43. \[\033[35m\]\h\
  44. \[\033[00m\]:\
  45. \[\033[34m\]\w\
  46. \[\033[00m\]]\
  47. \[\033[00m\]\$\
  48. '
  49. # Macro for archives extraction
  50. extract()
  51. {
  52. if [[ -f $1 ]]; then
  53. case $1 in
  54. *.tar.bz2) tar xvjf $1 ;;
  55. *.tar.gz) tar xvzf $1 ;;
  56. *.bz2) bunzip2 $1 ;;
  57. *.rar) unrar x $1 ;;
  58. *.gz) gunzip $1 ;;
  59. *.tar) tar xvf $1 ;;
  60. *.tbz2) tar xvjf $1 ;;
  61. *.tgz) tar xvzf $1 ;;
  62. *.zip) unzip $1 ;;
  63. *.Z) uncompress $1 ;;
  64. *.7z) 7z x $1 ;;
  65. *) echo "Don't know how to extract '$1'..." ;;
  66. esac
  67. else
  68. echo "'$1' is not a valid file !"
  69. fi
  70. }
  71. # Personal macro to live without the f*cking GNOME-keyring which can't handle ED25519 keys...
  72. keys()
  73. {
  74. if [[ $1 == "up" ]]; then
  75. # Let's load the keys into the SSH agent, for 1 hour
  76. ssh-add -t 3600
  77. elif [[ $1 == "down" ]]; then
  78. # Let's unload the keys (why would you do that ?)
  79. ssh-add -D
  80. else
  81. # Just print out the loaded keys...
  82. ssh-add -l
  83. fi
  84. }