From ddcd4c83f478513ba7650ad6d12991caf2d4a661 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 11 Nov 2025 22:03:07 +0000 Subject: [PATCH] Many things --- .config/ghostty/config | 6 +-- .config/nvim | 2 +- .config/shell/aliasrc | 13 +++++- .config/tmux/tmux.conf | 5 +++ .config/yazi/init.lua | 7 +++ .config/yazi/keymap.toml | 97 ++++++++++++++++++++++++++++++++++++++++ .config/yazi/yazi.toml | 12 +++++ .config/zsh/.zshrc | 2 + 8 files changed, 137 insertions(+), 7 deletions(-) create mode 100644 .config/yazi/init.lua create mode 100644 .config/yazi/keymap.toml create mode 100644 .config/yazi/yazi.toml diff --git a/.config/ghostty/config b/.config/ghostty/config index c06aee4..2639b7a 100644 --- a/.config/ghostty/config +++ b/.config/ghostty/config @@ -2,6 +2,8 @@ keybind = all:unconsumed:ctrl+shift+a=unbind keybind = all:unconsumed:ctrl+shift+p=unbind keybind = all:unconsumed:ctrl+shift+,=reload_config keybind = all:unconsumed:ctrl+shift+v=paste_from_clipboard +keybind = all:unconsumed:ctrl+shift+n=new_window +keybind = all:unconsumed:ctrl+shift+c=copy_to_clipboard #resize_split:down,10 keybind = all:unconsumed:super+ctrl+shift+arrow_down=unbind @@ -41,16 +43,12 @@ keybind = all:unconsumed:ctrl+shift+arrow_left=unbind keybind = all:unconsumed:ctrl+shift+arrow_right=unbind #select_all keybind = all:unconsumed:ctrl+shift+a=unbind -#copy_to_clipboard -keybind = all:unconsumed:ctrl+shift+c=unbind #new_split:down keybind = all:unconsumed:ctrl+shift+e=unbind #inspector:toggle keybind = all:unconsumed:ctrl+shift+i=unbind #write_screen_file:paste keybind = all:unconsumed:ctrl+shift+j=unbind -#new_window -keybind = all:unconsumed:ctrl+shift+n=unbind #new_split:right keybind = all:unconsumed:ctrl+shift+o=unbind #toggle_command_palette diff --git a/.config/nvim b/.config/nvim index 2255489..8e2d413 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 2255489fd881b389518649a43f1e3d5c92992cbe +Subproject commit 8e2d413e0a6adee197fe2a36a405255124a6a183 diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 8660420..996c85d 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -97,9 +97,9 @@ alias \ alias \ sail='[ -f sail ] && sh sail || sh vendor/bin/sail' \ yi="yarn install" \ - y="yarn" \ + yr="yarn" \ ci="composer install" \ - c="composer" \ + cm="composer" \ tk="go-task" \ mux="tmuxinator" \ mex="tmuxinator stop-all" \ @@ -173,6 +173,15 @@ function git_main_branch() { echo master } +# Yazi shortcut that allows setting the current working directory on exit +function y() { + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd + yazi "$@" --cwd-file="$tmp" + IFS= read -r -d '' cwd < "$tmp" + [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd" + rm -f -- "$tmp" +} + # Git aliases alias \ g="git" \ diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 92aad93..0c527fe 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -30,6 +30,11 @@ set -g escape-time 0 # Proxy focus events set -g focus-events on +# Settings for yazi image preview in tmux https://yazi-rs.github.io/docs/image-preview/ +set -g allow-passthrough on +set -ga update-environment TERM +set -ga update-environment TERM_PROGRAM + # Set the default terminal mode to 256color mode. set -g default-terminal "screen-256color" diff --git a/.config/yazi/init.lua b/.config/yazi/init.lua new file mode 100644 index 0000000..338e15a --- /dev/null +++ b/.config/yazi/init.lua @@ -0,0 +1,7 @@ +--[[ +Install yazi plugins +ya pkg add yazi-rs/plugins:git +ya pkg add dedukun/bookmarks +--]] + +require("git"):setup() diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml new file mode 100644 index 0000000..0fa97fa --- /dev/null +++ b/.config/yazi/keymap.toml @@ -0,0 +1,97 @@ +[[mgr.prepend_keymap]] +on = "" +run = "search --via=fd" +desc = "Find a file" + +[[mgr.prepend_keymap]] +on = "" +run = "search --via=rg" +desc = "Find a file" + +# Bookmarks +[[mgr.prepend_keymap]] +on = [ "g", "d" ] +run = "cd ~/Downloads" +desc = "Cd to ~/Downloads" + +[[mgr.prepend_keymap]] +on = [ "g", "s" ] +run = "cd ~/Stardust" +desc = "Cd to ~/Stardust" + +[[mgr.prepend_keymap]] +on = [ "g", "l" ] +run = "cd ~/Stardust/Library" +desc = "Cd to ~/Stardust/Library" + +[[mgr.prepend_keymap]] +on = [ "g", "g" ] +run = "cd ~/Stardust/Library/Role Playing Games/Games/" +desc = "Cd to ~/Stardust/Library/Role Playing Games/Games/" + +# dedukun/bookmarks keymaps +[[mgr.prepend_keymap]] +on = [ "m" ] +run = "plugin bookmarks save" +desc = "Save current position as a bookmark" + +[[mgr.prepend_keymap]] +on = [ "'" ] +run = "plugin bookmarks jump" +desc = "Jump to a bookmark" + +[[mgr.prepend_keymap]] +on = [ "b", "d" ] +run = "plugin bookmarks delete" +desc = "Delete a bookmark" + +[[mgr.prepend_keymap]] +on = [ "b", "D" ] +run = "plugin bookmarks delete_all" +desc = "Delete all bookmarks" + +# dedukun/relative-motions keymaps +[[mgr.prepend_keymap]] +on = [ "1" ] +run = "plugin relative-motions 1" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "2" ] +run = "plugin relative-motions 2" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "3" ] +run = "plugin relative-motions 3" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "4" ] +run = "plugin relative-motions 4" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "5" ] +run = "plugin relative-motions 5" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "6" ] +run = "plugin relative-motions 6" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "7" ] +run = "plugin relative-motions 7" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "8" ] +run = "plugin relative-motions 8" +desc = "Move in relative steps" + +[[mgr.prepend_keymap]] +on = [ "9" ] +run = "plugin relative-motions 9" +desc = "Move in relative steps" diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..7137bf8 --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,12 @@ +[mgr] +show_hidden = true + +[[plugin.prepend_fetchers]] +id = "git" +name = "*" +run = "git" + +[[plugin.prepend_fetchers]] +id = "git" +name = "*/" +run = "git" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 9a8e5d5..0bb3553 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -186,3 +186,5 @@ source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting. [[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh . "$HOME/.local/share/../bin/env" + +eval "$(zoxide init --cmd cd zsh)"