From 9ee61f9c33296ee711b2afa9ae44196cc1dba1cb Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Sun, 15 Dec 2024 06:35:40 +0100 Subject: [PATCH] Nvim Update, Some Aliases --- .config/nvim | 2 +- .../default.target.wants/ra-multiplex.service | 1 + .gitconfig | 1 + .zshrc | 35 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 120000 .config/systemd/user/default.target.wants/ra-multiplex.service diff --git a/.config/nvim b/.config/nvim index 61d0f5c..44c9268 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 61d0f5cf4cbd89f5c3676f72e2a3bd31b85880cd +Subproject commit 44c9268d6753bdc543fa9f2984aeea94af810e0f diff --git a/.config/systemd/user/default.target.wants/ra-multiplex.service b/.config/systemd/user/default.target.wants/ra-multiplex.service new file mode 120000 index 0000000..a9b9db5 --- /dev/null +++ b/.config/systemd/user/default.target.wants/ra-multiplex.service @@ -0,0 +1 @@ +/home/snoweuph/.config/systemd/user/ra-multiplex.service \ No newline at end of file diff --git a/.gitconfig b/.gitconfig index 75df9b0..0cbd6f7 100644 --- a/.gitconfig +++ b/.gitconfig @@ -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" diff --git a/.zshrc b/.zshrc index 8c7cbe1..845c9d0 100644 --- a/.zshrc +++ b/.zshrc @@ -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 +} +