Skip to content

Instantly share code, notes, and snippets.

@qwinters
Last active February 21, 2022 11:51
Show Gist options
  • Save qwinters/1cfb8ed3da53144b0526a1a8ace65e8d to your computer and use it in GitHub Desktop.
Save qwinters/1cfb8ed3da53144b0526a1a8ace65e8d to your computer and use it in GitHub Desktop.
Better ZSH/cli defaults for MacOS

Requirements

If you are uncertain if you have the requirements, run this script:

brew install ack bat coreutils dateutils exa fzf neovim npm rsync trash \
  && npm install --global gtop
# Misc. Setup
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
clear
# Save old defaults
alias Ack="\\ack"
alias Cat="\\cat"
alias Cp="\\cp"
alias Date="\\date"
alias Df="\\df"
alias Diff="\\diff"
alias Du="\\du"
alias Fgrep="\\fgrep"
alias Grep="\\grep"
alias Ls="\\ls"
alias Mkdir="\\mkdir"
alias Rm="\\rm"
alias Top="\\top"
alias Vim="\\vim"
alias Fzf="\\fzf"
# Create new better defaults
alias ack="ack --smart-case --pager=bat"
alias cat="bat"
alias cp="rsync -a --progress --stats"
alias date="gdate"
alias df="gdf -h"
alias diff="ydiff"
alias du="gdu -h -d 2"
alias fgrep="gfgrep --color=auto"
alias fzf="fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"
alias grep="ggrep --color=auto"
alias ll="exa --long --classify --group-directories-first --bytes --header --links --git --time-style=long-iso -a"
alias ln="gln -i"
alias ls="exa --long --classify --group-directories-first --bytes --header --links --git --time-style=long-iso"
alias pgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
alias rm="trash"
alias top="gtop"
alias tree="exa --long --classify --group-directories-first --bytes --header --links --git --time-style=long-iso -T"
alias vim="nvim"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment