Created
May 14, 2020 04:10
-
-
Save ejisoo/38d99e13f1de94b225dfeb7e2e427d49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Self | |
| alias bashrc='$EDITOR ~/.bashrc && source ~/.bashrc' | |
| alias aliases='$EDITOR ~/.aliases && source ~/.aliases' | |
| alias functions='$EDITOR ~/.functions && source ~/.functions' | |
| alias vim="nvim" | |
| alias nvimrc='nvim ~/.config/nvim/init.vim' | |
| # Unix | |
| alias c="clear" | |
| alias ..="cd .." | |
| alias ...="cd ../.." | |
| alias ....="cd ../../.." | |
| alias mkdir="mkdir -pv" | |
| # alias cp="rsync -avh --progress" | |
| # # Detect which `ls` flavor is in use | |
| # if ls --color > /dev/null 2>&1; then # GNU `ls` | |
| # colorflag="--color" | |
| # else # OS X `ls` | |
| # colorflag="-G" | |
| # fi | |
| # List all files colorized in long format | |
| # alias l="ls -lF ${colorflag}" | |
| alias ls="ls --color" | |
| alias l="ls -lF" | |
| alias lh="ls -AlhF" | |
| # List only directories | |
| alias lsd="ls -lF | grep --color=never '^d'" | |
| alias lf="ls -Gltr | grep --color=never '^d'" | |
| alias la="ls -laF" | |
| # alias ll.="ls -ldFh" | |
| # helpers | |
| alias ddu="du -h -c -d 1 | gsort -h" | |
| alias fdu="du -hs * | gsort -h" | |
| # Shortcuts | |
| alias dl="cd ~/Downloads" | |
| alias dt="cd ~/Desktop" | |
| alias w="cd ~/Workspaces" | |
| alias h="history" | |
| alias unar="unar -q" | |
| alias path="echo -e ${PATH//:/\\n}" | |
| # alias et="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" | |
| # alias ds="export -f fs && find . -maxdepth 1 -type d -exec bash -c 'fs "$0"' {} \;" | |
| # alias ds="find . -maxdepth 1 -type d -exec bash -c 'fs "$0"' {} \;" | |
| # tmux | |
| alias t="tmux -u" | |
| alias ta='tmux attach' | |
| alias tat='tmux new-session -As `basename "$PWD" | sed -e "s/\./-/g"`' | |
| # Some fix to work with directory names with whitespace | |
| # alias tat='tmux new-session -As `basename $PWD | sed -e "s/\./-/g;s/\ /\\\ /g"`' | |
| alias tk='tmux kill-session' | |
| alias tmux-set-title='tmux rename-session `basename $PWD | sed -e "s/\./-/g"`' | |
| alias tmuxkillall="tmux ls | cut -d : -f 1 | xargs -I {} tmux kill-session -t {}" | |
| # git | |
| alias lu="git ls-files --others --exclude-standard" | |
| alias git-add="rm-osx-cruft && git add" | |
| # scripts | |
| alias rmdots="find . -type f -prune \( -name '._*' -or -name '.DS_Store' -or -name 'Thumbs.db' \) -print0 | xargs -0 rm -v " | |
| alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" | |
| # alias cleanup="find . -type f -name '.*' -ls -delete" | |
| alias cleanhidden="find . -name ".*" -type f -exec rm -rf {} +" | |
| # alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" | |
| alias chromekill="ps ux | grep 'Google Chrom' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" | |
| alias nbkill="ps ax | grep jupyter | grep -v grep | cut -d ' ' -f1 | xargs kill -9" | |
| # Get week number | |
| alias week='date +%V' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment