-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases.sh
51 lines (39 loc) · 1020 Bytes
/
.aliases.sh
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
# Notes:
# Aim for key strikes with alternate hands on qwerty keyboard.
function chtsh () {
lang=$1
shift
query=$@
curl http://cht.sh/$lang/${query// /+} | less --RAW-CONTROL-CHARS
}
# List
alias la='ls -a'
alias ll='ls -l'
alias lla='ls -la'
alias llh='ls -lh'
# Vim
alias vim='nvim'
alias nv='nvim'
# Git
alias g='git'
alias gg='git status'
alias gh='git checkout'
alias gi='git diff'
alias gis='git diff --staged'
alias gk='git commit' # kommit
alias gka='git commit --amend'
alias gkan='git commit --amend --no-edit'
alias gl='git log'
alias gn='git branch'
alias gnc="git branch | sed -n 's/\* //p'"
alias gp='git add' # put
alias gr='git rev-parse --show-toplevel'
alias ghs='git push'
alias gll='git pull'
# Github
function github_repo_url() {
git config --get remote.origin.url | sed -E 's/.*github.com[:/](.*).git/https:\/\/github.com\/\1/'
}
alias gho='open $(github_repo_url)'
alias ghod='open $(github_repo_url)/compare/$(gnc)'
alias ghopr='open $(github_repo_url)/compare/$(gnc)\?expand=1'