forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
90 lines (61 loc) · 2.48 KB
/
.aliases
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
## Bash
# -l long format
# -A show dot files (without ./ and ../)
# -h adds human readable dates
# -p add a slash to folders
# -F adds more flags to other files
# disable temporalily with \ls
alias ls='ls -lAhpF'
# Common mistakes
alias cd..='cd ..'
alias pnig='ping'
alias gti='git'
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
## Git
# Show the last bit of the log
alias lol='clear; git lola --color=always | head -n 20'
# Include changes into last commit
alias yep='git a; git commit --amend --no-edit'
# Use the force, but never push force
alias please='git push --force-with-lease'
# Drop changes, including newly created files
alias nah='git reset --hard; git clean -df'
# Reset local branch to matching remote branch
alias drop='git reset --hard @{upstream}'
# When you forget to push with `-u`
alias predrop='git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)'
# Switch back and forth between last branches
alias pop='git switch -'
# Rebase over last branch
alias reb='git rebase -i -'
# Undo last commit but leave changes for diff
alias undo='git reset --soft HEAD^ && git reset HEAD --'
# Reinit submodules
alias submod='git submodule deinit --all --force && git submodule update --init --recursive'
# Expects a commit hash to be fixup
# Later: git rebase -i --autosquash
alias fixup='git commit -a --fixup'
## Node
# Used to run mocha without local config
alias mocha='$(npm bin)/mocha --config /home/gvivas/.mocharc.yml'
## Docker
# Show `docker ps` as a vertical table (takes less horizontal space)
export DOCKER_VFMT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
alias dps='docker ps --format="${DOCKER_VFMT}"'
## Utilities
# See: https://github.com/adriancooney/Taskfile
alias task=./Taskfile
# Show global modules
alias npmls='npm list -g --depth=0'
alias gols='\ls -p /usr/local/go/bin/ | grep -v "\/\|^go$\|^gofmt$"'
alias rustls='\ls -p ~/.cargo/bin/ | grep -v "\/\|rust\|cargo\|clippy"'
## Terminal color scheme
# https://mayccoll.github.io/Gogh/
# 03 08 11 13 17 18 29 32 35 51 54 66 67 69 90 93 96
# 104 109 110 111 112 114 122 136 138 142 144 147 152
alias colorscheme='bash -c "$(wget -qO- https://git.io/vQgMr)"'
# pip3 install --user termtosvg
# npm -g install localtunnel
# sudo apt-get install tldr