Nvim Update, Some Aliases

This commit is contained in:
Snoweuph 2024-12-15 06:35:40 +01:00
parent 275145e822
commit 9ee61f9c33
Signed by: snoweuph
GPG key ID: BEFC41DA223CEC55
4 changed files with 38 additions and 1 deletions

@ -1 +1 @@
Subproject commit 61d0f5cf4cbd89f5c3676f72e2a3bd31b85880cd
Subproject commit 44c9268d6753bdc543fa9f2984aeea94af810e0f

View file

@ -0,0 +1 @@
/home/snoweuph/.config/systemd/user/ra-multiplex.service

View file

@ -28,3 +28,4 @@
fl = push --force-with-lease
prune-branches = "!git fetch -p && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -d"
show-last-commit = diff HEAD^
unstage = "restore --staged"

35
.zshrc
View file

@ -39,6 +39,7 @@ WORDCHARS="_-" # Define These Characters as Part of "Words"
# Application Envs
#########################################################
export EDITOR=nvim
# GPG
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
@ -105,3 +106,37 @@ alias edit-zsh-conf="nvim ~/.zshrc"
alias hist="eval \$(cat $HISTFILE | fzf)"
alias nano="nvim"
alias neofetch="fastfetch"
alias notes="glow $HOME/DOKUMENTE/NOTES --all"
ws() {
local -A path_icons=(
["$HOME/Workspace/Learning"]='3,󰑴 '
["$HOME/Workspace/School"]='3, '
["$HOME/Workspace/AdventOfCode"]='3, '
["$HOME/Workspace"]='2, '
["$HOME/Downloads"]='2,󰇚'
["$HOME"]='1, '
)
typeset -A display_to_path
find "$HOME/Workspace" -type d \( -name ".git" -o -name "go.mod" -o -name "Cargo.toml" -o -name "compose.yaml" -o -name "package.json" \) -exec dirname {} \; | sort -u | \
while IFS= read -r line; do
display_line="$line"
best_prio=0
for path_target entry in "${(@kv)path_icons}"; do
if [[ $line == $path_target* ]]; then
IFS=, read -r prio icon <<< "$entry"
if [[ $prio -gt $best_prio ]]; then
display_line="$icon${line//$path_target/}"
best_prio=$prio
fi
fi
done
display_to_path[$display_line]=$line
done
selected=$display_to_path[$(printf "%s\n" "${(@k)display_to_path}" | fzf)]
if [[ -n $selected ]]; then
cd $selected
fi
}