nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

command_overrides (2030B)


      1 # vim: ft=sh
      2 
      3 # GNU Coreutils that might not be installed with default names on OSX.
      4 # Lint warning for expansion at definition is disabled as that's intentional.
      5 #
      6 # shellcheck disable=SC2139
      7 {
      8 	alias grep="$(use_first_to_exist grep)"
      9 	alias ls="$(use_first_to_exist eza ls)"
     10 	alias sed="$(use_first_to_exist sed)"
     11 	alias awk="$(use_first_to_exist awk)"
     12 	alias diff="$(use_first_to_exist difft diff)"
     13 	alias vim="$(use_first_to_exist nvim vim vi)"
     14 }
     15 
     16 man() {
     17 	"$config_home"/.nix-profile/bin/man "$@" || command man "$@"
     18 }
     19 
     20 alias cp='cp --backup=numbered --reflink=auto --sparse=always'
     21 alias mv='mv --backup=numbered'
     22 alias ln='ln --backup=numbered'
     23 
     24 alias fd='fd --color never --hidden --exclude .git --exclude $HOME/misc/mnt --exclude /nix'
     25 alias rg='rg --hidden -i'
     26 
     27 alias eza='eza -a --sort=modified'
     28 
     29 alias startx='exec startx &>| /tmp/startx-$USER'
     30 
     31 alias wl-copy='wl-copy -n'
     32 alias wl-paste='wl-paste -n'
     33 
     34 # Disable sourcing systemwide vim configuration. Also set PYTHONPATH to
     35 # include basedir so we can edit tests that get their sys.path munged by nose
     36 
     37 # $config_home comes from shell init
     38 
     39 # Do not disable raw control chars when running less
     40 alias less='less -R'
     41 
     42 alias ipython='ipython --no-banner'
     43 
     44 # Do not pass a (potentially unsupported) locale when SSHing to random servers.
     45 # In mosh, a UTF-8 aware locale is needed, so we use en_US.UTF-8 because
     46 # there's a high likelihood that it will be available ('Murica baby!).
     47 safe_termname() {
     48 	case $TERM in
     49 	rxvt*) echo rxvt ;;
     50 	xterm*) echo xterm ;;
     51 	*) echo linux ;;
     52 	esac
     53 }
     54 
     55 for command in ssh{,rc}; do
     56 	# shellcheck disable=SC2139
     57 	alias "$command"='LC_ALL=C TERM="$(safe_termname)" '"$command"
     58 done
     59 
     60 alias mosh='LC_ALL=en_US.UTF-8 mosh'
     61 alias sshrc='LC_ALL=en_US.UTF-8 sshrc'
     62 alias sshs='sshs --show-proxy-command'
     63 
     64 # Allow other aliases to be used after the program name
     65 alias sudo='sudo '
     66 alias watch='watch '
     67 
     68 alias gdb='gdb -q'
     69 alias bazel='bazelisk'
     70 
     71 alias dmesg='dmesg -T --color=always | less -R +G'
     72 
     73 alias pracomer='pracomer --file /tmp/pracomer.log'