-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaliases
More file actions
110 lines (93 loc) · 2.57 KB
/
aliases
File metadata and controls
110 lines (93 loc) · 2.57 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#! /bin/bash
export EDITOR=hx
source <(fzf --zsh)
source <(zoxide init zsh --cmd cd)
source <(starship init zsh)
# Variables
PROJECT_PATH_PYTHON="/home/mavenried/Projects/python/"
PROJECT_PATH_RUST="/home/mavenried/Projects/rust"
PROJECT_PATH_SCRIPTS="/mnt/DATA/scripts"
#zsh opts
setopt numericglobsort autocd extendedglob
eval "$(proj-cmd init zsh)"
PATH=$PATH:"./bin:/home/mavenried/.local/bin:$PROJECT_PATH_SCRIPTS"
function mav() {
macchina --theme mavencore -o host -o machine -o distribution -o uptime -o memory -o processor-load
}
function bak() {
for f in "$@"; do
if [[ "$f" == *.bak ]]; then
target="${f%.bak}"
if [[ -e "$target" ]]; then
echo "Skipping $f: $target already exists"
else
mv -- "$f" "$target"
fi
else
if [[ -e "$f.bak" ]]; then
echo "Skipping $f: $f.bak already exists"
else
mv -- "$f" "$f.bak"
fi
fi
done
}
function index() {
if [[ "$1" == "" ]]; then
dir=$(pwd)
else
dir=$1
fi
echo "Opening $dir/indexer.json in nvim..."
$EDITOR "$dir/indexer.json"
}
function config() {
$EDITOR "/mnt/DATA/dots/$1"
}
function clean() {
files=$(fd target $PROJECT_PATH_RUST -t d -u)
if [[ "$files" == "" ]]; then
printf "\x1b[31mNothing to clean.\x1b[0m\n"
else
printf "\x1b[33mFound the following directories:\n\x1b[31m%s\n\x1b[0m" "$files"
if gum confirm --default=false "Do you want to delete these directories?"; then
gum spin --title="Removing..." -- fd target $PROJECT_PATH_RUST -t d -u --exec rm -fr {}
fi
fi
}
function open() {
for file in "$@"; do
xdg-open "$file"
done
}
function mkcd() {
mkdir -p "$1"
cd "$1" || return 1
}
# Call mav once
mav
# Plugin init
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Aliases
alias pip="python3 -m pip install --break-system-packages"
alias ls="eza -l"
alias indexer="python3 $PROJECT_PATH_PYTHON/Indexer/main.py"
alias lyrics="playerctl --format=\"{{title}} by {{artist}}\" metadata | lyrics.py"
alias mkdate="mkcd $(date +%d%m%y)"
alias gc="git commit"
alias gacp="git add . && git commit && git push"
alias install="yes|yay -S"
alias uninstall="yay -R"
alias update="yay -Syu --noconfirm"
alias lsa="eza -la"
alias q=exit
alias icat="kitten icat"
alias pls=sudo
alias btop="btop --force-utf"
alias bkp="rsync -aAXv --delete --info=progress2 /mnt/DATA/ /run/media/mavenried/MavenDATA/DATA-bkp"
alias sl=ls
alias edit=$EDITOR
alias cat=bat
alias clone="git clone --depth=1"
alias nvim=hx