-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zsh_aliases
84 lines (74 loc) · 2.86 KB
/
.zsh_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
alias l="ls -CF";
alias ls="ls --color"
alias la="ls -lahF";
alias lg="lazygit";
alias conda="micromamba";
alias nnn="nnn -e"
alias neofetch="fastfetch -c neofetch";
alias mp3="yt-dlp -x --audio-format mp3 -o '%(title)s.%(ext)s'";
alias mp4="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o '%(title)s.%(ext)s'";
alias vs="cd ~/dotfiles; $EDITOR home.nix";
alias vv="cd ~/dotfiles; $EDITOR .config/nvim";
alias vy='cd ~/dotfiles; $EDITOR .config/yabai/yabairc'
alias vh='cd ~/dotfiles; $EDITOR .config/skhd/skhdrc'
alias vt='cd ~/dotfiles; $EDITOR .tmux.conf'
alias vw='cd ~/dotfiles; $EDITOR .config/wezterm/wezterm.lua'
alias v=gvim
alias copy='pbcopy' # macos
alias paste='pbpaste' # macos
alias ip="curl -4 icanhazip.com"
alias localip="ipconfig getifaddr en0"
alias m="[ -f Makefile ] && rg '^([a-zA-Z0-9_-]+):.*' Makefile -r '\$1' -N | fzf | xargs make"
alias aaaa="mpv ~/.local/assets/aaaa.mp3 &> /dev/null &"
alias bruh="mpv ~/.local/assets/bruh.mp3 &> /dev/null &"
alias ohio="mpv ~/.local/assets/ohio.mp3 &> /dev/null &"
alias swag="mpv ~/.local/assets/swag.mp3 &> /dev/null &"
alias boom="mpv ~/.local/assets/boom.mp3 &> /dev/null &"
alias canon="mpv ~/.local/assets/canon.mp3 &> /dev/null &"
alias slap="mpv ~/.local/assets/slap.mp3 &> /dev/null &"
alias wt=wezterm
alias code="open -a 'Visual Studio Code'"
alias sbcl="rlwrap sbcl"
alias hm=home-manager
notif() {
osascript -e "display notification \"$1\" sound name \"Ping\""
}
timezsh() { repeat 10 { time zsh -i -c exit } }
# ex: pdfpages source.pdf 2-5 output.pdf
pdfpages() {
pdftk $1 cat $2 output $3
}
# cd to any directory starting at $HOME
# does not include ~/Library/
sd(){
dir=$(rg --hidden --files --null -g '!Library/' ${HOME} 2>/dev/null | xargs -0 dirname 2>/dev/null | awk '!x[$0]++' | fzf --height 10 --query "/$1")
if [ ! -z "$dir" ]; then
cd $dir
fi
}
n ()
{
# ~~Block nesting of nnn in subshells~~ as much nesting as you could ever want
# [ "${NNNLVL:-0}" -eq 0 ] || {
# echo "nnn is already running"
# return
# }
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see. To cd on quit only on ^G, remove the "export" and make sure not to
# use a custom path, i.e. set NNN_TMPFILE *exactly* as follows:
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The command builtin allows one to alias nnn to n, if desired, without
# making an infinitely recursive alias
command nnn -e "$@"
[ ! -f "$NNN_TMPFILE" ] || {
. "$NNN_TMPFILE"
rm -f -- "$NNN_TMPFILE" > /dev/null
}
}