Public part of my dotfiles.
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.9 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
11 months ago
3 years ago
  1. #!/usr/bin/env sh
  2. #
  3. # Bash / ZSH aliases and customizations
  4. #
  5. # Shell options
  6. HISTSIZE=100000
  7. HISTFILE="$HOME/.cache/shell_history"
  8. ## COMMAND CONFIGURATION
  9. # Completion for existing commands
  10. alias cp="cp -i --reflink=auto"
  11. alias grep="grep --color=auto"
  12. alias dd='dd status=progress'
  13. alias rm='rm -v --one-file-system'
  14. alias free='free -m'
  15. alias diff='diff --color=auto'
  16. alias dmesg='dmesg --ctime'
  17. alias wget='wget --hsts-file $HOME/.cache/wget-hsts'
  18. # [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors...
  19. POWERLINE_GO_DEFAULT_OPTS=(-colorize-hostname -max-width 25 -cwd-max-dir-size 10 -modules 'user,host,venv,cwd,perms,git' -modules-right 'jobs,exit,duration,load') # For reading by shell profiles
  20. FZF_DEFAULT_OPTS="--height 40% --layout=default"
  21. FZF_CTRL_T_OPTS="--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'"
  22. FZF_COMPLETION_OPTS="${FZF_CTRL_T_OPTS}"
  23. # Colored ls
  24. _colored_ls() {
  25. \ls -lh --color=always $@ | awk '
  26. BEGIN {
  27. FPAT = "([[:space:]]*[^[:space:]]+)";
  28. OFS = "";
  29. }
  30. {
  31. $1 = "\033[36m" $1 "\033[0m";
  32. $2 = "\033[31m" $2 "\033[0m";
  33. $3 = "\033[32m" $3 "\033[0m";
  34. $4 = "\033[32m" $4 "\033[0m";
  35. $5 = "\033[31m" $5 "\033[0m";
  36. $6 = "\033[34m" $6 "\033[0m";
  37. $7 = "\033[34m" $7 "\033[0m";
  38. print
  39. }
  40. '
  41. }
  42. alias ll="_colored_ls"
  43. alias la="_colored_ls -a"
  44. # To keep until https://github.com/openssh/openssh-portable/commit/f64f8c00d158acc1359b8a096835849b23aa2e86
  45. # is merged
  46. function _ssh {
  47. if [ "${TERM}" = "alacritty" ]
  48. then
  49. TERM=xterm-256color ssh "$@"
  50. else
  51. ssh "$@"
  52. fi
  53. }
  54. alias ssh='_ssh'
  55. ## FUNCTIONS