-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases.zsh
57 lines (45 loc) · 1.21 KB
/
aliases.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# General
alias ..="cd ../"
alias vim="nvim"
# Git
alias gd="git diff"
alias gs="git status"
alias ga="git add ."
alias gc="git checkout"
alias gcm="git checkout master"
alias gca="git commit --amend"
alias gp="git push"
alias gpf="git push --force-with-lease"
# Programs
alias gotop="gotop --color=monokai -p -b"
if [ $(command -v bat) ]; then
alias cat='bat'
alias catt='/usr/bin/cat'
fi
# Open modified files
# ACMR = Added || Copied || Modified || Renamed
# U = Unmerged (conflicting)
# TM = Changed || Modified
alias vd="vim \$(git diff HEAD --name-only --diff-filter=ACMR)"
alias vds="vim \$(git diff --staged --name-only --diff-filter=ACMR)"
alias vda="vim \$(git diff HEAD^ --name-only --diff-filter=TM)"
alias vdc="vim \$(git diff --name-only --diff-filter=U)"
# Clipboard
# $<some command> | copy
alias copy="xclip -sel clip"
# Format json in clipboard
alias jsontidy="xclip -o | jq '.' | copy"
# XDG open
alias o=xdg-open
# Asciinema to GIF
alias asciicast2gif="docker run --rm -v $(pwd):/data asciinema/asciicast2gif"
# Ansible
alias av="ansible-vault"
alias ap="ansible-playbook"
# Sudo vim
alias svim="sudoedit"
# Manage.py: Django
alias ma="./manage.py"
if [[ "$OSTYPE" == "darwin"* ]] then
alias sed="gsed"
fi