aliases (2239B) - raw
1 # vim: filetype=zsh 2 3 alias clear="printf '\033c'" 4 5 # colors 6 alias ls="ls -hv --color=auto --group-directories-first" 7 alias grep="grep --color=auto" 8 alias fgrep="fgrep --color=auto" 9 alias egrep="egrep --color=auto" 10 alias diff="diff --color=auto" 11 12 # options aliases 13 alias cp="cp --interactive" 14 alias mv="mv --interactive" 15 alias mkdir="mkdir --parents" 16 alias rm="rm -I" 17 18 # shortcuts 19 alias v="nvim" 20 alias vim="nvim" 21 alias vimdiff="nvim -d" 22 alias g="git" 23 alias t="tmux new -As0" 24 alias c="git --git-dir=$HOME/.local/share/dotfiles/repo.git --work-tree=$HOME" 25 alias gv="nvim -c Git -c only" 26 alias cv="(cd $HOME; GIT_DIR=$HOME/.local/share/dotfiles/repo.git GIT_WORK_TREE=$HOME nvim -c Git -c only)" 27 alias ca="cal -m -3" 28 29 # I should probably change to "4." instead of "....." 30 alias ..="cd .." 31 alias ...="cd ../.." 32 alias ....="cd ../../.." 33 alias .....="cd ../../../.." 34 alias ......="cd ../../../../.." 35 alias .......="cd ../../../../../.." 36 alias ........="cd ../../../../../../.." 37 alias .........="cd ../../../../../../../.." 38 alias ..........="cd ../../../../../../../../.." 39 alias ...........="cd ../../../../../../../../../.." 40 alias ............="cd ../../../../../../../../../../.." 41 alias .............="cd ../../../../../../../../../../../.." 42 43 # frequent files and directories 44 alias cfa="$EDITOR $XDG_CONFIG_HOME/zsh/aliases" 45 alias cfe="$EDITOR $XDG_CONFIG_HOME/zsh/zshenv" 46 alias cfg="$EDITOR $XDG_CONFIG_HOME/git/config" 47 alias cft="$EDITOR $XDG_CONFIG_HOME/tmux/tmux.conf" 48 alias cfv="$EDITOR $XDG_CONFIG_HOME/nvim/init.vim" 49 alias cfx="$EDITOR $XDG_CONFIG_HOME/Xresources" 50 alias cfz="$EDITOR $XDG_CONFIG_HOME/zsh/zshrc" 51 alias cfh="$EDITOR $XDG_CONFIG_HOME/zsh/host-$(hostname -s)" 52 53 alias db="cd $HOME/.local/bin && ls" 54 alias dc="cd $HOME/Documents && ls" 55 alias ds="cd $HOME/.local/src && ls" 56 alias dv="cd $XDG_CONFIG_HOME/nvim && ls" 57 alias dw="cd $HOME/Downloads && ls" 58 59 # dotfiles' repository metafiles 60 c-clean() { 61 rm -f "$HOME/README.md" "$HOME/COPYING" "$HOME/bootstrap.sh" 62 c update-index --skip-worktree "$HOME/README.md" "$HOME/COPYING" "$HOME/bootstrap.sh" 63 } 64 65 c-populate() { 66 c update-index --no-skip-worktree "$HOME/README.md" "$HOME/COPYING" "$HOME/bootstrap.sh" 67 c checkout "$HOME/README.md" "$HOME/COPYING" "$HOME/bootstrap.sh" 68 }