⚙️ config(yazi): a bunch of changes to the keymaps

This commit is contained in:
Sergio Laín 2025-02-17 23:33:47 +01:00
parent 0b70efc562
commit 1d1f760e97
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
2 changed files with 17 additions and 52 deletions

View file

@ -187,3 +187,7 @@ require("yatline-githead"):setup({
})
require("git"):setup()
require("fg"):setup({
default_action = "jump",
})

View file

@ -4,8 +4,8 @@
prepend_keymap = [
{ on = [
"<C-s>",
], 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 = [
"<C-y>",
], 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 = ["<Esc>"], run = "close", desc = "Cancel input" }]
[completion]
prepend_keymap = [
{ on = "<C-k>", run = "arrow -1", desc = "Move cursor up" },