-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_alias
64 lines (54 loc) · 2.14 KB
/
dot_alias
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
# Aliases
# lsd, fancy `ls` replacement
# https://github.com/Peltoche/lsd
if [[ -n 'which lsd' ]]; then
alias ls='lsd'
fi
# Git Aliases
alias gfc='git fetch upstream && git checkout upstream/master'
alias gfr='git fetch upstream && git rebase -i upstream/master'
alias status='git status'
alias add='git add'
alias commit='git commit'
alias commitm='git commit -m'
alias checkout='git checkout'
alias gco='git checkout'
alias push='git push'
alias pull='git pull'
alias branch='git branch -v'
alias branches='git branch --all | fzf | xargs git checkout'
alias fetch='git fetch --all --prune'
alias remotes='git remote -v'
alias pullup='git checkout master && git fetch --all && git pull upstream master'
# Personal Shortcuts
alias home='cd ~ && ls -ABCF'
alias vi='vim'
alias vim='nvim'
alias edit=$EDITOR
alias la='ls -AF'
# alias ls='ls -F'
alias ding="echo $'\a'; paplay --volume 50000 /usr/share/sounds/freedesktop/stereo/complete.oga &"
alias servefiles="python3 -m http.server"
# Generate an SSH key easily using best practices (update periodically)
alias ssh-key-generate='ssh-keygen -o -a 100 -t ed25519 -C $EMAIL'
## Personal Writing Habit Shortcuts
alias writemode-enter-workdir="cd ~/Documents/Writing"
alias writemode-create-file="date +'%Y-%m-%d-tbd.md' | xargs -o touch"
alias writemode-begin-file="date +'%Y-%m-%d-tbd.md' | xargs -o vim"
alias writemode-setup="writemode-enter-workdir && writemode-create-file"
alias writemode-edit-latest-file="ls -Art -1 | tail -n 1 | xargs -o vim"
alias writemode="writemode-enter-workdir && writemode-begin-file"
alias writemode-resume="writemode-enter-workdir && writemode-edit-latest-file"
# Dotfile management per https://www.atlassian.com/git/tutorials/dotfiles
# alias dotfile='/usr/bin/git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME'
# Dotfile management per https://www.chezmoi.io/
function dotfile-edit {
chezmoi edit --apply "$@"
}
# Bat is a cat replacement with syntax highlighting and other niceties
# TODO: detect if bat is installed before defining this one
alias cat="bat --theme=OneHalfDark"
# Watch
alias watch="FORCE_COLOR=true watch --color"
# Kitty icat image viewer
alias showimg="kitty +kitten icat $1"