| 1 | #!/bin/sh |
| 2 | |
| 3 | # Use neovim for vim if present |
| 4 | [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" |
| 5 | |
| 6 | # lsa='ls -lAhN --group-directories-first --color=auto' \ |
| 7 | # ls='ls -hN --group-directories-first --color=auto' \ |
| 8 | alias \ |
| 9 | ls='eza -x' \ |
| 10 | lsa='eza -la' \ |
| 11 | nb="newsboat" \ |
| 12 | sxiv="nsxiv" \ |
| 13 | hst="history 1 -1 | cut -c 8- | sort | uniq | fzf | tr -d '\n' | wl-copy" \ |
| 14 | |
| 15 | # Verbosity and settings that you pretty much just always are going to want. |
| 16 | alias \ |
| 17 | cp="cp -iv" \ |
| 18 | mv="mv -iv" \ |
| 19 | rm="rm -vI" \ |
| 20 | yt="yt-dlp --embed-metadata -i -o '%(title)s.%(ext)s'" \ |
| 21 | yta="yt -x -f bestaudio/best" \ |
| 22 | ytbdl="yt-dlp -f bestvideo+bestaudio -o '%(title)s.%(ext)s' --external-downloader=aria2c" \ |
| 23 | ytdl="yt-dlp -f best -o '%(title)s.%(ext)s' --external-downloader=aria2c" |
| 24 | |
| 25 | # yt="yt-dlp --embed-metadata -i -o '%(title)s.%(ext)s' --external-downloader=aria2c" \ |
| 26 | |
| 27 | alias on="tmux new-session -s notes -c ~/dox/brain 'nvim .'" |
| 28 | alias todo="nvim ~/dox/brain/Todo.md" |
| 29 | alias dots="cd ~/aurora/" |
| 30 | alias cava="cava -p ~/.cache/matugen/cava" # colours from matugen |
| 31 | |
| 32 | # Colorize commands when possible. |
| 33 | alias \ |
| 34 | grep="grep --color=auto" \ |
| 35 | diff="diff --color=auto" \ |
| 36 | ip="ip -color=auto" |
| 37 | |
| 38 | |
| 39 | # git aliases |
| 40 | alias \ |
| 41 | ga='git add' \ |
| 42 | gc='git commit' \ |
| 43 | gp='git push' \ |
| 44 | gC='git clone' |
| 45 | |
| 46 | ec() {find ~/.config \( -type f -o -type l \) | fzf | xargs -r $EDITOR} |
| 47 | es() { cd ~/.local/bin; $EDITOR $(fzf) ;} |
| 48 | ef() {fzf | xargs -r -I % $EDITOR % ;} |
| 49 | of() {fzf | xargs -r -I % xdg-open % ; } |
| 50 | colors() { |
| 51 | for COLOR in {1..255}; do |
| 52 | echo -en "\e[38;5;${COLOR}m" |
| 53 | echo -n "${COLOR} " |
| 54 | done |
| 55 | echo |
| 56 | } |
| 57 | # movie() { |
| 58 | # filename="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)" -printf "%f\n" | fzf)" |
| 59 | # filepath="$(find ~/movies/ -type f -regex ".*\.\(mkv\|mp4\|mpeg\|avi\|mov\|webm\)")" |
| 60 | # mpv "$(grep "$filename" <<< "$filepath")" |
| 61 | # } |