From 1d1f760e97f2439491aceeeabe3bae5ca9766249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Mon, 17 Feb 2025 23:33:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20config(yazi):=20a=20bunch?= =?UTF-8?q?=20of=20changes=20to=20the=20keymaps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/yazi/init.lua | 4 +++ .config/yazi/keymap.toml | 65 ++++++++-------------------------------- 2 files changed, 17 insertions(+), 52 deletions(-) diff --git a/.config/yazi/init.lua b/.config/yazi/init.lua index 1f92db66..dbcd34a2 100644 --- a/.config/yazi/init.lua +++ b/.config/yazi/init.lua @@ -187,3 +187,7 @@ require("yatline-githead"):setup({ }) require("git"):setup() + +require("fg"):setup({ + default_action = "jump", +}) diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml index c113d7db..5e47e607 100644 --- a/.config/yazi/keymap.toml +++ b/.config/yazi/keymap.toml @@ -4,8 +4,8 @@ prepend_keymap = [ { on = [ - "", - ], run = '''shell "$SHELL" --block''', desc = "Open shell here" }, + "!", + ], run = 'shell "$SHELL" --block', desc = "Open shell here" }, { on = [ "c", "a", @@ -20,33 +20,26 @@ prepend_keymap = [ "f", "g", ], run = "plugin fg", desc = "find file by content (fuzzy match)" }, - { on = [ - "f", - "G", - ], run = "plugin fg --args='rg'", desc = "find file by content (ripgrep match)" }, - { on = [ - "f", - "n", - ], run = "plugin fg --args='fzf'", desc = "find file by filename" }, { on = [ "f", "f", ], run = "filter --smart", desc = "Filter files" }, - { on = [ - "f", - "F", - ], run = "plugin smart-filter", desc = "Smart Filter" }, { on = [ "s", - ], run = "plugin searchjump", desc = "searchjump mode" }, - { on = "S", run = "search fd", desc = "Search files by name using fd" }, - { on = [ - "T", - ], run = "plugin hide-preview", desc = "Hide or show the preview" }, + ], run = "plugin searchjump", desc = "Flash" }, + { on = "S", run = "search --via=fd", desc = "Search files by name using fd" }, { on = [ "", - ], run = '''shell 'for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'''', desc = "Copy to clipboard" }, + ], run = 'shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list', desc = "Copy to clipboard" }, { on = "A", run = "create --dir", desc = "Create a dir" }, + { on = [ + "g", + "r", + ], run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"', desc = "Root of Git Repo" }, + { on = "H", run = "tab_switch -1 --relative", desc = "Switch to the previous tab" }, + { on = "L", run = "tab_switch 1 --relative", desc = "Switch to the next tab" }, + { on = "<", run = "tab_swap -1", desc = "Swap current tab with previous tab" }, + { on = ">", run = "tab_swap 1", desc = "Swap current tab with next tab" }, ] append_keymap = [ @@ -56,40 +49,8 @@ append_keymap = [ { on = [ "E", ], run = "open --interactive", desc = "Open the selected files interactively" }, - { on = [ - "g", - "n", - ], run = "cd ~/.config/nvim/", desc = "Go to the nvim directory" }, - { on = [ - "g", - "v", - ], run = "cd ~/videos/", desc = "Go to the videos directory" }, - { on = [ - "g", - "p", - ], run = "cd ~/pictures/", desc = "Go to the pictures directory" }, - { on = [ - "g", - "s", - ], run = "cd ~/pictures/screenshots/", desc = "Go to the screenshots directory" }, - { on = [ - "g", - "D", - ], run = "cd ~/documents/", desc = "Go to the docs directory" }, - { on = [ - "g", - "o", - ], run = "cd ~/documents/obsidian/personal-brain/", desc = "Go to the obsidian directory" }, - { on = [ - "g", - "e", - ], run = "cd ~/dev/", desc = "Go to the dev directory" }, ] -[input] - -prepend_keymap = [{ on = [""], run = "close", desc = "Cancel input" }] - [completion] prepend_keymap = [ { on = "", run = "arrow -1", desc = "Move cursor up" },