-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
35 lines (30 loc) · 800 Bytes
/
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
#!/bin/zsh
# Commands
alias ls='ls --color'
alias vim=nvim
# Save and load paths
alias savepath="pwd > /tmp/savepath"
alias loadpath="[ -f /tmp/savepath ] && \`cat /tmp/savepath\` || echo /tmp/savepath does not exist."
# Git aliases
alias gupp="git fetch && git rebase && git push"
alias gl='git pull --rebase'
alias gdc='git diff --cached'
# Common mistypings
alias mkae="make"
alias maek="make"
alias rkae="rake"
alias raek="rake"
alias sprunge="curl -F 'sprunge=<-' http://sprunge.us 2>/dev/null|pbcopy"
# Fuzzy cd
function fcd() {
local dir
dir=$(
fd \
--type directory |
fzf \
--bind 'focus:transform-preview-label:echo [ {} ]' \
--preview 'tree -C -L 1 {} || ls --color=always {}' \
--query="$*"
)
[[ -n "${dir}" ]] && cd "${dir}"
}