Krolyxon
Commit 892d77e

Branches

Refs →

aurora.configshellaliasrc

60 lines · 2.0 KB · Bourne Again Shell (bash)

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