From 4bb15d851e405c5237dff5255f67e16cc9a94950 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr / DashieTM Date: Tue, 12 Mar 2024 02:46:53 +0100 Subject: [PATCH] feat: Improve yazi --- environment.d/envvars.conf | 4 +- fish/config.fish | 12 + nvim/lazy-lock.json | 64 ++-- nvim/lazyvim.json | 2 +- nvim/lua/config/keymaps.lua | 5 - nvim/lua/config/options.lua | 1 - nvim/lua/plugins/cmp.lua | 2 + nvim/lua/plugins/dashboard.lua | 10 +- nvim/lua/plugins/plugins.lua | 144 ++----- yazi/keymap.toml | 676 +++++++++++++++++++++++++-------- yazi/plugins/glow.yazi | 1 + yazi/plugins/miller.yazi | 1 + yazi/theme.toml | 149 ++++++++ yazi/yazi.toml | 88 ++--- 14 files changed, 782 insertions(+), 377 deletions(-) create mode 160000 yazi/plugins/glow.yazi create mode 160000 yazi/plugins/miller.yazi create mode 100644 yazi/theme.toml diff --git a/environment.d/envvars.conf b/environment.d/envvars.conf index 0d04bf8..f63c10f 100644 --- a/environment.d/envvars.conf +++ b/environment.d/envvars.conf @@ -1,8 +1,8 @@ NEOVIDE_MAXIMIZED=0 GPG_TTY=$(tty) PATH=/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin:~/.cargo/bin:$PATH -EDITOR="neovide --novsync --nofork" -SUDO_EDITOR="neovide --novsync --nofork" +EDITOR="neovide --no-fork" +SUDO_EDITOR="neovide --no-fork" PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LD_LIBRARY_PATH=/usr/local/lib SCRIPTS=$HOME/.config/scripts diff --git a/fish/config.fish b/fish/config.fish index cffb69f..0ea4023 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -14,6 +14,18 @@ function sudo --description "Replacement for Bash 'sudo !!' command to run last command sudo $argv end end + +function y + set tmp (mktemp -t "yazi-cwd.XXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -- "$tmp" +end + +set EDITOR "neovide --no-fork" + alias ls='lsd' alias :q='exit' alias gh='git push origin' diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 31822b9..928df6e 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,10 +1,10 @@ { - "LazyVim": { "branch": "main", "commit": "fe72424e77cb9c953084bbcaaa0eb7fe8056dc70" }, + "LazyVim": { "branch": "main", "commit": "e3bfcb9bf74292dc846f5d1710fbb2e8f36a687a" }, "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, - "SchemaStore.nvim": { "branch": "main", "commit": "d91daa5bf63c409f9e752e55082c3ba088b04c0b" }, + "SchemaStore.nvim": { "branch": "main", "commit": "b788bde023f9fbc2eb86e89d32c0bf98a60ae406" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" }, - "catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "catppuccin": { "branch": "main", "commit": "045e3499d9ec8d84635fb08877ae44fd33f6a38d" }, "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" }, "cmake-tools.nvim": { "branch": "master", "commit": "055d7bb37d5c4038ce1e400656b6504602934ce7" }, "cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" }, @@ -12,24 +12,22 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "34b81e70da83e26c048290204de44268eb59814e" }, - "crates.nvim": { "branch": "main", "commit": "ec2b04a380c9f3a8e6ca38c230e4990d71978143" }, + "conform.nvim": { "branch": "master", "commit": "5a15cc46e75cad804fd51ec5af9227aeb1d1bdaa" }, + "crates.nvim": { "branch": "main", "commit": "535773ed3b321d68ddd6ef8cd5a1e07b345026a6" }, "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, - "edgy.nvim": { "branch": "main", "commit": "0b35dc6da4cae6cc2f724bc610eadf955cd2319b" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "inc-rename.nvim": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" }, - "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, + "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, "ltex_extra.nvim": { "branch": "master", "commit": "42dd3572cb09b52a137e91e515f2dff5eb631b1e" }, - "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" }, + "lualine.nvim": { "branch": "master", "commit": "3c55675a7bc170d21d7ea70874ae66fbf5cfb0dc" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, @@ -38,52 +36,50 @@ "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" }, - "neoconf.nvim": { "branch": "main", "commit": "8d7150e9d6113f01421c34c5aeb0f586afa232e0" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7f2ebdef3b55374390714ac7c0a7fe6b0dae498a" }, + "neoconf.nvim": { "branch": "main", "commit": "d21739358bca9811f783c9a3d5e91c7b3abc3005" }, "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "neoscroll.nvim": { "branch": "master", "commit": "6e3546751076890304428150e53bd59198a4505d" }, + "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, "neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" }, "neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" }, "neotest-python": { "branch": "master", "commit": "2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50" }, - "neotest-rust": { "branch": "main", "commit": "9e9df68064bd6fa3b5e40b32fcb7c52af130cdbf" }, - "nui.nvim": { "branch": "main", "commit": "fbb139c6f14896b434d0229099e1acd863ae6bec" }, + "nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, "nvim-dap-go": { "branch": "main", "commit": "64f73400761e2d19459e664a52ea478f3a4420e7" }, "nvim-dap-python": { "branch": "master", "commit": "66560f0ebddf96604f7037e1efad3ba6942761e6" }, "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "a5fc69240869c0fee8ff176bc9e4efdf8bdfb596" }, - "nvim-jdtls": { "branch": "master", "commit": "382b9f625861f47d95876bcfb4c261f3b96077cb" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "baa5b0dc6663284cce32e0d00ac1f2511b13496f" }, + "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, "nvim-lint": { "branch": "master", "commit": "e824adb9bc01647f71e55457353a68f0f37f9931" }, - "nvim-lspconfig": { "branch": "master", "commit": "7f5cf1121f772850a30bdaf83fb448e88846aa58" }, + "nvim-lspconfig": { "branch": "master", "commit": "1917b562a02f20885900b1da0f0ea25028ccedab" }, "nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" }, - "nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" }, - "nvim-treesitter": { "branch": "master", "commit": "212b7a504cf56f85d1acc5be237261b42d7560c5" }, - "nvim-treesitter-context": { "branch": "master", "commit": "53cdd58446521575d8f1052152099e08b15ca53c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "3532f6095efd4723f7c066a5ac3fe632506cc09e" }, + "nvim-treesitter": { "branch": "master", "commit": "b781fd058224f67df7469b8f376c42a8d85e11db" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, - "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "4be2e8689067494ed7e5a4f1221adc31d1a07783" }, + "nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" }, + "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "f7310a06ad86072158adc37f394650e7fba9631d" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "rustaceanvim": { "branch": "master", "commit": "5dc35a075ad7c9d2f6493065e1e5970e4ad61504" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "48ffb8de688a22942940f50411d5928631368848" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "8839e3f8070dfafa5b0c0e4652700298e7b872c4" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-project.nvim": { "branch": "master", "commit": "1aaf16580a614601a7f7077d9639aeb457dc5559" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "dc1ea28cc2a02cd1cebb9d80e967807d668f78f8" }, + "telescope.nvim": { "branch": "master", "commit": "7472420f8734c710bd7009081cef9b97f08a3821" }, "test_plugin": { "branch": "main", "commit": "c6100b07b2f7925e5bb639c6b42427f9aa362add" }, "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, - "tree-sitter-hyprlang": { "branch": "master", "commit": "fc1d331586e4da2b5f5bcfa89d630ebafe66458b" }, + "tokyonight.nvim": { "branch": "main", "commit": "c025baf23b62f044eff1f4ef561c45de636f0e32" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "typst.vim": { "branch": "main", "commit": "ff57d27cf5ee7427941a63fb537714f9a80e0246" }, - "venv-selector.nvim": { "branch": "main", "commit": "93ee4ac249277571a90db5b50aae83d6f9d036f5" }, + "venv-selector.nvim": { "branch": "main", "commit": "2ad34f36d498ff5193ea10f79c87688bd5284172" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" }, "vim-visual-multi": { "branch": "master", "commit": "fe1ec7e430013b83c8c2dee85ae496251b71e253" }, "vimtex": { "branch": "master", "commit": "a77d14b2e4391c0d3e860708bb1fd56161ab68eb" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "yazi.nvim": { "branch": "master", "commit": "b5c9390c733244b10859b940413ef9741955301a" } } \ No newline at end of file diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index ff6a139..f4e2010 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -5,5 +5,5 @@ "news": { "NEWS.md": "2123" }, - "version": 2 + "version": 3 } \ No newline at end of file diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index ce7239a..7a5c8db 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -131,11 +131,6 @@ map("n", "z", function() require("telescope").extensions.zoxide.list({}) end, { desc = "Zoxide" }) --- nvimtree -map("n", "", function() - require("nvim-tree.api").tree.toggle() -end, { noremap = true, silent = true, desc = "Toggle file tree" }) - -- neoscroll local t = {} t[""] = { "scroll", { "-vim.wo.scroll", "true", "250" } } diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 164d889..7fadc1a 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -8,7 +8,6 @@ local options = { termguicolors = true, spelllang = "en_us", shell = "/usr/bin/fish", - autochdir = true, relativenumber = false, scrolloff = 5, scrolljump = 5, diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index 9d2019c..d8650fc 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -25,6 +25,7 @@ return { }, { "hrsh7th/nvim-cmp", + version = false, event = "InsertEnter", dependencies = { "hrsh7th/cmp-nvim-lsp", @@ -140,3 +141,4 @@ return { end, }, } + diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua index 5f89ca4..82715ad 100644 --- a/nvim/lua/plugins/dashboard.lua +++ b/nvim/lua/plugins/dashboard.lua @@ -41,14 +41,8 @@ return { } dashboard.section.buttons.val = { dashboard.button("f", " Find file", ":lua require('telescope.builtin').find_files()"), - dashboard.button( - "b", - " Open File Browser", - ":lua require('telescope').extensions.file_browser.file_browser{}" - ), - dashboard.button("e", " New file", ":ene startinsert "), - dashboard.button("p", " Find project", ":lua require('telescope').extensions.project.project{}"), - dashboard.button("r", " Recently used files", ":lua require('telescope.builtin').oldfiles() "), + dashboard.button("y", " Yazi", ":lua require('yazi').yazi()"), + dashboard.button("p", " Find project", ":lua require('telescope').extensions.project.project{}"), dashboard.button("t", " Zoxide", ":lua require('telescope').extensions.zoxide.list{}"), dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), dashboard.button("q", " Quit Neovim", ":qa"), diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index 453ba33..e7e0b4b 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -29,13 +29,6 @@ return { }, }, }, - { - "ThePrimeagen/harpoon", - lazy = true, - config = function() - require("telescope").load_extension("harpoon") - end, - }, { "nvim-telescope/telescope-project.nvim", lazy = true, @@ -93,12 +86,6 @@ return { ) end, }, - { - "rcarriga/nvim-notify", - opts = { - top_down = false, - }, - }, { "jbyuki/instant.nvim", config = function() @@ -194,113 +181,32 @@ return { end, }, { - "nvim-tree/nvim-tree.lua", - lazy = true, + "nvim-neo-tree/neo-tree.nvim", opts = { - view = { - centralize_selection = false, - side = "right", - }, - update_focused_file = { - enable = true, - update_root = false, - ignore_list = {}, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - system_open = { - cmd = "", - args = {}, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, + window = { + position = "right", + mappings = { + ["l"] = "none", }, }, }, - }, - -- { - -- "nvim-neo-tree/neo-tree.nvim", - -- opts = { - -- window = { - -- bind_to_cwd = true, - -- position = "right", - -- mappings = { - -- ["l"] = "none", - -- }, - -- }, - -- }, - -- keys = { - -- { - -- "fe", - -- function() - -- require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() }) - -- end, - -- desc = "Explorer NeoTree (root dir)", - -- }, - -- { - -- "fE", - -- function() - -- require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() }) - -- end, - -- desc = "Explorer NeoTree (cwd)", - -- }, - -- { "", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, - -- { "", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, - -- }, - -- }, - { - "folke/edgy.nvim", - opts = { - animate = { - enabled = false, + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() }) + end, + desc = "Explorer NeoTree (root dir)", }, - left = {}, - right = { - -- Neo-tree filesystem always takes half the screen height - { - title = "Neo-Tree", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "filesystem" - end, - size = { height = 0.5 }, - }, - { - title = "Neo-Tree Git", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "git_status" - end, - pinned = true, - open = "Neotree position=right git_status", - }, - { - title = "Neo-Tree Buffers", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "buffers" - end, - pinned = true, - open = "Neotree position=top buffers", - }, - { - ft = "Outline", - pinned = true, - open = "SymbolsOutlineOpen", - }, - -- any other neo-tree windows - "neo-tree", + { + "fE", + function() + require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() }) + end, + desc = "Explorer NeoTree (cwd)", }, + { "", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, + { "", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, }, }, { @@ -336,4 +242,14 @@ return { what = 0, }, }, + { + "DreamMaoMao/yazi.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + }, + keys = { + { "fy", "Yazi", desc = "Toggle Yazi" }, + }, + }, } diff --git a/yazi/keymap.toml b/yazi/keymap.toml index e3dfe26..a1782b0 100644 --- a/yazi/keymap.toml +++ b/yazi/keymap.toml @@ -1,233 +1,573 @@ [manager] keymap = [ - { on = [ "" ], exec = "escape", desc = "Exit visual mode, clear selected, or cancel search" }, - { on = [ "q" ], exec = "quit", desc = "Exit the process" }, - { on = [ "Q" ], exec = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" }, - { on = [ "" ], exec = "close", desc = "Close the current tab, or quit if it is last tab" }, - { on = [ "" ], exec = "suspend", desc = "Suspend the process" }, + { on = [ + "", + ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" }, + { on = [ + "q", + ], run = "quit", desc = "Exit the process" }, + { on = [ + "Q", + ], run = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" }, + { on = [ + "", + ], run = "close", desc = "Close the current tab, or quit if it is last tab" }, + { on = [ + "", + ], run = "suspend", desc = "Suspend the process" }, - # Navigation - { on = [ "l" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "k" ], exec = "arrow 1", desc = "Move cursor down" }, + # Navigation + { on = [ + "l", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "k", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "L" ], exec = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "K" ], exec = "arrow 5", desc = "Move cursor down 5 lines" }, + { on = [ + "L", + ], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = [ + "K", + ], run = "arrow 5", desc = "Move cursor down 5 lines" }, - { on = [ "" ], exec = "arrow -50%", desc = "Move cursor up half page" }, - { on = [ "" ], exec = "arrow 50%", desc = "Move cursor down half page" }, - { on = [ "" ], exec = "arrow -100%", desc = "Move cursor up one page" }, - { on = [ "" ], exec = "arrow 100%", desc = "Move cursor down one page" }, + { on = [ + "", + ], run = "arrow -50%", desc = "Move cursor up half page" }, + { on = [ + "", + ], run = "arrow 50%", desc = "Move cursor down half page" }, + { on = [ + "", + ], run = "arrow -100%", desc = "Move cursor up one page" }, + { on = [ + "", + ], run = "arrow 100%", desc = "Move cursor down one page" }, - { on = [ "j" ], exec = "leave", desc = "Go back to the parent directory" }, - { on = [ ";" ], exec = "enter", desc = "Enter the child directory" }, + { on = [ + "j", + ], run = "leave", desc = "Go back to the parent directory" }, + { on = [ + ";", + ], run = "enter", desc = "Enter the child directory" }, - { on = [ "J" ], exec = "back", desc = "Go back to the previous directory" }, - { on = [ "P" ], exec = "forward", desc = "Go forward to the next directory" }, + { on = [ + "J", + ], run = "back", desc = "Go back to the previous directory" }, + { on = [ + "P", + ], run = "forward", desc = "Go forward to the next directory" }, - { on = [ "" ], exec = "peek -5", desc = "Peek up 5 units in the preview" }, - { on = [ "" ], exec = "peek 5", desc = "Peek down 5 units in the preview" }, + { on = [ + "", + ], run = "peek -5", desc = "Peek up 5 units in the preview" }, + { on = [ + "", + ], run = "peek 5", desc = "Peek down 5 units in the preview" }, - { on = [ "" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], exec = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], exec = "leave", desc = "Go back to the parent directory" }, - { on = [ "" ], exec = "enter", desc = "Enter the child directory" }, + { on = [ + "", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "", + ], run = "arrow 1", desc = "Move cursor down" }, + { on = [ + "", + ], run = "leave", desc = "Go back to the parent directory" }, + { on = [ + "", + ], run = "enter", desc = "Enter the child directory" }, - { on = [ "g", "g" ], exec = "arrow -99999999", desc = "Move cursor to the top" }, - { on = [ "G" ], exec = "arrow 99999999", desc = "Move cursor to the bottom" }, + { on = [ + "g", + "g", + ], run = "arrow -99999999", desc = "Move cursor to the top" }, + { on = [ + "G", + ], run = "arrow 99999999", desc = "Move cursor to the bottom" }, - # Selection - { on = [ "" ], exec = [ "select --state=none", "arrow 1" ], desc = "Toggle the current selection state" }, - { on = [ "v" ], exec = "visual_mode", desc = "Enter visual mode (selection mode)" }, - { on = [ "V" ], exec = "visual_mode --unset", desc = "Enter visual mode (unset mode)" }, - { on = [ "" ], exec = "select_all --state=true", desc = "Select all files" }, - { on = [ "" ], exec = "select_all --state=none", desc = "Inverse selection of all files" }, + # Selection + { on = [ + "v", + ], run = "visual_mode", desc = "Enter visual mode (selection mode)" }, + { on = [ + "V", + ], run = "visual_mode --unset", desc = "Enter visual mode (unset mode)" }, + { on = [ + "", + ], run = "select_all --state=true", desc = "Select all files" }, + { on = [ + "", + ], run = "select_all --state=none", desc = "Inverse selection of all files" }, - # Operation - { on = [ "o" ], exec = "open", desc = "Open the selected files" }, - { on = [ "O" ], exec = "open --interactive", desc = "Open the selected files interactively" }, - { on = [ "" ], exec = "open", desc = "Open the selected files" }, - { on = [ "" ], exec = "open --interactive", desc = "Open the selected files interactively" }, # It's cool if you're using a terminal that supports CSI u - { on = [ "y" ], exec = "yank", desc = "Copy the selected files" }, - { on = [ "x" ], exec = "yank --cut", desc = "Cut the selected files" }, - { on = [ "p" ], exec = "paste", desc = "Paste the files" }, - { on = [ "P" ], exec = "paste --force", desc = "Paste the files (overwrite if the destination exists)" }, - { on = [ "-" ], exec = "link", desc = "Symlink the absolute path of files" }, - { on = [ "_" ], exec = "link --relative", desc = "Symlink the relative path of files" }, - { on = [ "d" ], exec = "remove", desc = "Move the files to the trash" }, - { on = [ "D" ], exec = "remove --permanently", desc = "Permanently delete the files" }, - { on = [ "a" ], exec = "create", desc = "Create a file or directory (ends with / for directories)" }, - { on = [ "r" ], exec = "rename", desc = "Rename a file or directory" }, - { on = [ ";" ], exec = "shell", desc = "Run a shell command" }, - { on = [ ":" ], exec = "shell --block", desc = "Run a shell command (block the UI until the command finishes)" }, - { on = [ "." ], exec = "hidden toggle", desc = "Toggle the visibility of hidden files" }, - { on = [ "s" ], exec = "search fd", desc = "Search files by name using fd" }, - { on = [ "S" ], exec = "search rg", desc = "Search files by content using ripgrep" }, - { on = [ "" ], exec = "search none", desc = "Cancel the ongoing search" }, - { on = [ "z" ], exec = "jump zoxide", desc = "Jump to a directory using zoxide" }, - { on = [ "Z" ], exec = "jump fzf", desc = "Jump to a directory, or reveal a file using fzf" }, + # Operation + { on = [ + "o", + ], run = "open", desc = "Open the selected files" }, + { on = [ + "O", + ], run = "open --interactive", desc = "Open the selected files interactively" }, + { on = [ + "", + ], run = "open", desc = "Open the selected files" }, + { on = [ + "", + ], run = "open --interactive", desc = "Open the selected files interactively" }, # It's cool if you're using a terminal that supports CSI u + { on = [ + "y", + ], run = "yank", desc = "Copy the selected files" }, + { on = [ + "x", + ], run = "yank --cut", desc = "Cut the selected files" }, + { on = [ + "p", + ], run = "paste", desc = "Paste the files" }, + { on = [ + "P", + ], run = "paste --force", desc = "Paste the files (overwrite if the destination exists)" }, + { on = [ + "-", + ], run = "link", desc = "Symlink the absolute path of files" }, + { on = [ + "_", + ], run = "link --relative", desc = "Symlink the relative path of files" }, + { on = [ + "d", + ], run = "remove", desc = "Move the files to the trash" }, + { on = [ + "D", + ], run = "remove --permanently", desc = "Permanently delete the files" }, + { on = [ + "a", + ], run = "create", desc = "Create a file or directory (ends with / for directories)" }, + { on = [ + "r", + ], run = "rename", desc = "Rename a file or directory" }, + { on = [ + ";", + ], run = "shell", desc = "Run a shell command" }, + { on = [ + ":", + ], run = "shell --block", desc = "Run a shell command (block the UI until the command finishes)" }, + { on = [ + ".", + ], run = "hidden toggle", desc = "Toggle the visibility of hidden files" }, + { on = [ + "", + "f", + "g>", + ], run = "search fd", desc = "Search files by name using fd" }, + { on = [ + "", + "f", + "G>", + ], run = "search rg", desc = "Search files by content using ripgrep" }, + { on = [ + "", + ], run = "search none", desc = "Cancel the ongoing search" }, + { on = [ + "z", + ], run = "jump zoxide", desc = "Jump to a directory using zoxide" }, + { on = [ + "Z", + ], run = "jump fzf", desc = "Jump to a directory, or reveal a file using fzf" }, - # Copy - { on = [ "c", "c" ], exec = "copy path", desc = "Copy the absolute path" }, - { on = [ "c", "d" ], exec = "copy dirname", desc = "Copy the path of the parent directory" }, - { on = [ "c", "f" ], exec = "copy filename", desc = "Copy the name of the file" }, - { on = [ "c", "n" ], exec = "copy name_without_ext", desc = "Copy the name of the file without the extension" }, + # Copy + { on = [ + "c", + "c", + ], run = "copy path", desc = "Copy the absolute path" }, + { on = [ + "c", + "d", + ], run = "copy dirname", desc = "Copy the path of the parent directory" }, + { on = [ + "c", + "f", + ], run = "copy filename", desc = "Copy the name of the file" }, + { on = [ + "c", + "n", + ], run = "copy name_without_ext", desc = "Copy the name of the file without the extension" }, - # Find - { on = [ "/" ], exec = "find --smart" }, - { on = [ "?" ], exec = "find --previous --smart" }, - { on = [ "n" ], exec = "find_arrow" }, - { on = [ "N" ], exec = "find_arrow --previous" }, + # Find + { on = [ + "/", + ], run = "find --smart" }, + { on = [ + "?", + ], run = "find --previous --smart" }, + { on = [ + "n", + ], run = "find_arrow" }, + { on = [ + "N", + ], run = "find_arrow --previous" }, - # Sorting - { on = [ ",", "a" ], exec = "sort alphabetical --dir_first", desc = "Sort alphabetically" }, - { on = [ ",", "A" ], exec = "sort alphabetical --reverse --dir_first", desc = "Sort alphabetically (reverse)" }, - { on = [ ",", "c" ], exec = "sort created --dir_first", desc = "Sort by creation time" }, - { on = [ ",", "C" ], exec = "sort created --reverse --dir_first", desc = "Sort by creation time (reverse)" }, - { on = [ ",", "m" ], exec = "sort modified --dir_first", desc = "Sort by modified time" }, - { on = [ ",", "M" ], exec = "sort modified --reverse --dir_first", desc = "Sort by modified time (reverse)" }, - { on = [ ",", "n" ], exec = "sort natural --dir_first", desc = "Sort naturally" }, - { on = [ ",", "N" ], exec = "sort natural --reverse --dir_first", desc = "Sort naturally (reverse)" }, - { on = [ ",", "s" ], exec = "sort size --dir_first", desc = "Sort by size" }, - { on = [ ",", "S" ], exec = "sort size --reverse --dir_first", desc = "Sort by size (reverse)" }, + # Sorting + { on = [ + ",", + "a", + ], run = "sort alphabetical --dir_first", desc = "Sort alphabetically" }, + { on = [ + ",", + "A", + ], run = "sort alphabetical --reverse --dir_first", desc = "Sort alphabetically (reverse)" }, + { on = [ + ",", + "c", + ], run = "sort created --dir_first", desc = "Sort by creation time" }, + { on = [ + ",", + "C", + ], run = "sort created --reverse --dir_first", desc = "Sort by creation time (reverse)" }, + { on = [ + ",", + "m", + ], run = "sort modified --dir_first", desc = "Sort by modified time" }, + { on = [ + ",", + "M", + ], run = "sort modified --reverse --dir_first", desc = "Sort by modified time (reverse)" }, + { on = [ + ",", + "n", + ], run = "sort natural --dir_first", desc = "Sort naturally" }, + { on = [ + ",", + "N", + ], run = "sort natural --reverse --dir_first", desc = "Sort naturally (reverse)" }, + { on = [ + ",", + "s", + ], run = "sort size --dir_first", desc = "Sort by size" }, + { on = [ + ",", + "S", + ], run = "sort size --reverse --dir_first", desc = "Sort by size (reverse)" }, - # Tabs - { on = [ "t" ], exec = "tab_create --current", desc = "Create a new tab using the current path" }, + # Tabs + { on = [ + "t", + ], run = "tab_create --current", desc = "Create a new tab using the current path" }, - { on = [ "1" ], exec = "tab_switch 0", desc = "Switch to the first tab" }, - { on = [ "2" ], exec = "tab_switch 1", desc = "Switch to the second tab" }, - { on = [ "3" ], exec = "tab_switch 2", desc = "Switch to the third tab" }, - { on = [ "4" ], exec = "tab_switch 3", desc = "Switch to the fourth tab" }, - { on = [ "5" ], exec = "tab_switch 4", desc = "Switch to the fifth tab" }, - { on = [ "6" ], exec = "tab_switch 5", desc = "Switch to the sixth tab" }, - { on = [ "7" ], exec = "tab_switch 6", desc = "Switch to the seventh tab" }, - { on = [ "8" ], exec = "tab_switch 7", desc = "Switch to the eighth tab" }, - { on = [ "9" ], exec = "tab_switch 8", desc = "Switch to the ninth tab" }, + { on = [ + "1", + ], run = "tab_switch 0", desc = "Switch to the first tab" }, + { on = [ + "2", + ], run = "tab_switch 1", desc = "Switch to the second tab" }, + { on = [ + "3", + ], run = "tab_switch 2", desc = "Switch to the third tab" }, + { on = [ + "4", + ], run = "tab_switch 3", desc = "Switch to the fourth tab" }, + { on = [ + "5", + ], run = "tab_switch 4", desc = "Switch to the fifth tab" }, + { on = [ + "6", + ], run = "tab_switch 5", desc = "Switch to the sixth tab" }, + { on = [ + "7", + ], run = "tab_switch 6", desc = "Switch to the seventh tab" }, + { on = [ + "8", + ], run = "tab_switch 7", desc = "Switch to the eighth tab" }, + { on = [ + "9", + ], run = "tab_switch 8", desc = "Switch to the ninth tab" }, - { on = [ "[" ], exec = "tab_switch -1 --relative", desc = "Switch to the previous tab" }, - { on = [ "]" ], exec = "tab_switch 1 --relative", desc = "Switch to the next tab" }, + { on = [ + "[", + ], run = "tab_switch -1 --relative", desc = "Switch to the previous tab" }, + { on = [ + "]", + ], run = "tab_switch 1 --relative", desc = "Switch to the next tab" }, - { on = [ "{" ], exec = "tab_swap -1", desc = "Swap the current tab with the previous tab" }, - { on = [ "}" ], exec = "tab_swap 1", desc = "Swap the current tab with the next tab" }, + { on = [ + "{", + ], run = "tab_swap -1", desc = "Swap the current tab with the previous tab" }, + { on = [ + "}", + ], run = "tab_swap 1", desc = "Swap the current tab with the next tab" }, - # Tasks - { on = [ "w" ], exec = "tasks_show", desc = "Show the tasks manager" }, + # Tasks + { on = [ + "w", + ], run = "tasks_show", desc = "Show the tasks manager" }, - # Goto - { on = [ "g", "h" ], exec = "cd ~", desc = "Go to the home directory" }, - { on = [ "g", "c" ], exec = "cd ~/.config", desc = "Go to the config directory" }, - { on = [ "g", "d" ], exec = "cd ~/Downloads", desc = "Go to the downloads directory" }, - { on = [ "g", "t" ], exec = "cd /tmp", desc = "Go to the temporary directory" }, - { on = [ "g", "" ], exec = "cd --interactive", desc = "Go to a directory interactively" }, + # Goto + { on = [ + "g", + "h", + ], run = "cd ~", desc = "Go to the home directory" }, + { on = [ + "g", + "c", + ], run = "cd ~/.config", desc = "Go to the config directory" }, + { on = [ + "g", + "d", + ], run = "cd ~/Downloads", desc = "Go to the downloads directory" }, + { on = [ + "g", + "t", + ], run = "cd /tmp", desc = "Go to the temporary directory" }, + { on = [ + "g", + "", + ], run = "cd --interactive", desc = "Go to a directory interactively" }, - # Help - { on = [ "~" ], exec = "help", desc = "Open help" }, + # Help + { on = [ + "~", + ], run = "help", desc = "Open help" }, ] [tasks] keymap = [ - { on = [ "" ], exec = "close", desc = "Hide the task manager" }, - { on = [ "" ], exec = "close", desc = "Hide the task manager" }, - { on = [ "w" ], exec = "close", desc = "Hide the task manager" }, + { on = [ + "", + ], run = "close", desc = "Hide the task manager" }, + { on = [ + "", + ], run = "close", desc = "Hide the task manager" }, + { on = [ + "w", + ], run = "close", desc = "Hide the task manager" }, - { on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" }, + { on = [ + "k", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "j", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], exec = "arrow 1", desc = "Move cursor down" }, + { on = [ + "", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], exec = "inspect", desc = "Inspect the task" }, - { on = [ "x" ], exec = "cancel", desc = "Cancel the task" }, + { on = [ + "", + ], run = "inspect", desc = "Inspect the task" }, + { on = [ + "x", + ], run = "cancel", desc = "Cancel the task" }, - { on = [ "~" ], exec = "help", desc = "Open help" } + { on = [ + "~", + ], run = "help", desc = "Open help" }, ] [select] keymap = [ - { on = [ "" ], exec = "close", desc = "Cancel selection" }, - { on = [ "" ], exec = "close", desc = "Cancel selection" }, - { on = [ "" ], exec = "close --submit", desc = "Submit the selection" }, + { on = [ + "", + ], run = "close", desc = "Cancel selection" }, + { on = [ + "", + ], run = "close", desc = "Cancel selection" }, + { on = [ + "", + ], run = "close --submit", desc = "Submit the selection" }, - { on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" }, + { on = [ + "k", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "j", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" }, + { on = [ + "K", + ], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = [ + "J", + ], run = "arrow 5", desc = "Move cursor down 5 lines" }, - { on = [ "" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], exec = "arrow 1", desc = "Move cursor down" }, + { on = [ + "", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "~" ], exec = "help", desc = "Open help" } + { on = [ + "~", + ], run = "help", desc = "Open help" }, ] [input] keymap = [ - { on = [ "" ], exec = "close", desc = "Cancel input" }, - { on = [ "" ], exec = "close --submit", desc = "Submit the input" }, - { on = [ "" ], exec = "escape", desc = "Go back the normal mode, or cancel input" }, + { on = [ + "", + ], run = "close", desc = "Cancel input" }, + { on = [ + "", + ], run = "close --submit", desc = "Submit the input" }, + { on = [ + "", + ], run = "escape", desc = "Go back the normal mode, or cancel input" }, - # Mode - { on = [ "i" ], exec = "insert", desc = "Enter insert mode" }, - { on = [ "a" ], exec = "insert --append", desc = "Enter append mode" }, - { on = [ "v" ], exec = "visual", desc = "Enter visual mode" }, - { on = [ "V" ], exec = [ "move -999", "visual", "move 999" ], desc = "Enter visual mode and select all" }, + # Mode + { on = [ + "i", + ], run = "insert", desc = "Enter insert mode" }, + { on = [ + "a", + ], run = "insert --append", desc = "Enter append mode" }, + { on = [ + "v", + ], run = "visual", desc = "Enter visual mode" }, + { on = [ + "V", + ], run = [ + "move -999", + "visual", + "move 999", + ], desc = "Enter visual mode and select all" }, - # Navigation - { on = [ "h" ], exec = "move -1", desc = "Move cursor left" }, - { on = [ "l" ], exec = "move 1", desc = "Move cursor right" }, + # Navigation + { on = [ + "h", + ], run = "move -1", desc = "Move cursor left" }, + { on = [ + "l", + ], run = "move 1", desc = "Move cursor right" }, - { on = [ "0" ], exec = "move -999", desc = "Move to the BOL" }, - { on = [ "$" ], exec = "move 999", desc = "Move to the EOL" }, - { on = [ "I" ], exec = [ "move -999", "insert" ], desc = "Move to the BOL, and enter insert mode" }, - { on = [ "A" ], exec = [ "move 999", "insert --append" ], desc = "Move to the EOL, and enter append mode" }, + { on = [ + "0", + ], run = "move -999", desc = "Move to the BOL" }, + { on = [ + "$", + ], run = "move 999", desc = "Move to the EOL" }, + { on = [ + "I", + ], run = [ + "move -999", + "insert", + ], desc = "Move to the BOL, and enter insert mode" }, + { on = [ + "A", + ], run = [ + "move 999", + "insert --append", + ], desc = "Move to the EOL, and enter append mode" }, - { on = [ "" ], exec = "move -1", desc = "Move cursor left" }, - { on = [ "" ], exec = "move 1", desc = "Move cursor right" }, + { on = [ + "", + ], run = "move -1", desc = "Move cursor left" }, + { on = [ + "", + ], run = "move 1", desc = "Move cursor right" }, - { on = [ "b" ], exec = "backward", desc = "Move to the beginning of the previous word" }, - { on = [ "w" ], exec = "forward", desc = "Move to the beginning of the next word" }, - { on = [ "e" ], exec = "forward --end-of-word", desc = "Move to the end of the next word" }, + { on = [ + "b", + ], run = "backward", desc = "Move to the beginning of the previous word" }, + { on = [ + "w", + ], run = "forward", desc = "Move to the beginning of the next word" }, + { on = [ + "e", + ], run = "forward --end-of-word", desc = "Move to the end of the next word" }, - # Deletion - { on = [ "d" ], exec = "delete --cut", desc = "Cut the selected characters" }, - { on = [ "D" ], exec = [ "delete --cut", "move 999" ], desc = "Cut until the EOL" }, - { on = [ "c" ], exec = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" }, - { on = [ "C" ], exec = [ "delete --cut --insert", "move 999" ], desc = "Cut until the EOL, and enter insert mode" }, - { on = [ "x" ], exec = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut the current character" }, + # Deletion + { on = [ + "d", + ], run = "delete --cut", desc = "Cut the selected characters" }, + { on = [ + "D", + ], run = [ + "delete --cut", + "move 999", + ], desc = "Cut until the EOL" }, + { on = [ + "c", + ], run = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" }, + { on = [ + "C", + ], run = [ + "delete --cut --insert", + "move 999", + ], desc = "Cut until the EOL, and enter insert mode" }, + { on = [ + "x", + ], run = [ + "delete --cut", + "move 1 --in-operating", + ], desc = "Cut the current character" }, - # Yank/Paste - { on = [ "y" ], exec = "yank", desc = "Copy the selected characters" }, - { on = [ "p" ], exec = "paste", desc = "Paste the copied characters after the cursor" }, - { on = [ "P" ], exec = "paste --before", desc = "Paste the copied characters before the cursor" }, + # Yank/Paste + { on = [ + "y", + ], run = "yank", desc = "Copy the selected characters" }, + { on = [ + "p", + ], run = "paste", desc = "Paste the copied characters after the cursor" }, + { on = [ + "P", + ], run = "paste --before", desc = "Paste the copied characters before the cursor" }, - # Undo/Redo - { on = [ "u" ], exec = "undo", desc = "Undo the last operation" }, - { on = [ "" ], exec = "redo", desc = "Redo the last operation" }, + # Undo/Redo + { on = [ + "u", + ], run = "undo", desc = "Undo the last operation" }, + { on = [ + "", + ], run = "redo", desc = "Redo the last operation" }, - # Help - { on = [ "~" ], exec = "help", desc = "Open help" } + # Help + { on = [ + "~", + ], run = "help", desc = "Open help" }, ] [help] keymap = [ - { on = [ "" ], exec = "escape", desc = "Clear the filter, or hide the help" }, - { on = [ "q" ], exec = "close", desc = "Exit the process" }, - { on = [ "" ], exec = "close", desc = "Hide the help" }, + { on = [ + "", + ], run = "escape", desc = "Clear the filter, or hide the help" }, + { on = [ + "q", + ], run = "close", desc = "Exit the process" }, + { on = [ + "", + ], run = "close", desc = "Hide the help" }, - # Navigation - { on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" }, + # Navigation + { on = [ + "k", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "j", + ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" }, + { on = [ + "K", + ], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = [ + "J", + ], run = "arrow 5", desc = "Move cursor down 5 lines" }, - { on = [ "" ], exec = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], exec = "arrow 1", desc = "Move cursor down" }, + { on = [ + "", + ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ + "", + ], run = "arrow 1", desc = "Move cursor down" }, - # Filtering - { on = [ "/" ], exec = "filter", desc = "Apply a filter for the help items" }, + # Filtering + { on = [ + "/", + ], run = "filter", desc = "Apply a filter for the help items" }, ] diff --git a/yazi/plugins/glow.yazi b/yazi/plugins/glow.yazi new file mode 160000 index 0000000..54b34c2 --- /dev/null +++ b/yazi/plugins/glow.yazi @@ -0,0 +1 @@ +Subproject commit 54b34c2b337ab0933130a06f61038398efa9ce65 diff --git a/yazi/plugins/miller.yazi b/yazi/plugins/miller.yazi new file mode 160000 index 0000000..a653e7a --- /dev/null +++ b/yazi/plugins/miller.yazi @@ -0,0 +1 @@ +Subproject commit a653e7a0e90327b0e8f53544c4af097df2e49bc7 diff --git a/yazi/theme.toml b/yazi/theme.toml new file mode 100644 index 0000000..1887003 --- /dev/null +++ b/yazi/theme.toml @@ -0,0 +1,149 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +# : Manager {{{ + +[manager] +cwd = { fg = "#94e2d5" } + +# Hovered +hovered = { reversed = true } +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true } +find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true } + +# Marker +marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" } +marker_cut = { fg = "#f38ba8", bg = "#f38ba8" } +marker_marked = { fg = "#f9e2af", bg = "#f9e2af" } +marker_selected = { fg = "#779EF0", bg = "#89b4fa" } + +# Tab +tab_active = { fg = "#1e1e2e", bg = "#cdd6f4" } +tab_inactive = { fg = "#cdd6f4", bg = "#45475a" } +tab_width = 1 + +# Count +count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" } +count_cut = { fg = "#1e1e2e", bg = "#f38ba8" } +count_selected = { fg = "#1e1e2e", bg = "#89b4fa" } + +# Border +border_symbol = "│" +border_style = { fg = "#7f849c" } + + +# : }}} + + +# : Status {{{ + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "#45475a", bg = "#45475a" } + +# Mode +mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true } +mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true } +mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true } + +# Progress +progress_label = { fg = "#ffffff", bold = true } +progress_normal = { fg = "#89b4fa", bg = "#45475a" } +progress_error = { fg = "#f38ba8", bg = "#45475a" } + +# Permissions +permissions_t = { fg = "#89b4fa" } +permissions_r = { fg = "#f9e2af" } +permissions_w = { fg = "#f38ba8" } +permissions_x = { fg = "#a6e3a1" } +permissions_s = { fg = "#7f849c" } + +# : }}} + + +# : Input {{{ + +[input] +border = { fg = "#89b4fa" } +title = {} +value = {} +selected = { reversed = true } + +# : }}} + + +# : Select {{{ + +[select] +border = { fg = "#89b4fa" } +active = { fg = "#f5c2e7" } +inactive = {} + +# : }}} + + +# : Tasks {{{ + +[tasks] +border = { fg = "#89b4fa" } +title = {} +hovered = { underline = true } + +# : }}} + + +# : Which {{{ + +[which] +mask = { bg = "#313244" } +cand = { fg = "#94e2d5" } +rest = { fg = "#9399b2" } +desc = { fg = "#f5c2e7" } +separator = "  " +separator_style = { fg = "#585b70" } + +# : }}} + + +# : Help {{{ + +[help] +on = { fg = "#f5c2e7" } +exec = { fg = "#94e2d5" } +desc = { fg = "#9399b2" } +hovered = { bg = "#585b70", bold = true } +footer = { fg = "#45475a", bg = "#cdd6f4" } + +# : }}} + + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#94e2d5" }, + + # Videos + { mime = "video/*", fg = "#f9e2af" }, + { mime = "audio/*", fg = "#f9e2af" }, + + # Archives + { mime = "application/zip", fg = "#f5c2e7" }, + { mime = "application/gzip", fg = "#f5c2e7" }, + { mime = "application/x-tar", fg = "#f5c2e7" }, + { mime = "application/x-bzip", fg = "#f5c2e7" }, + { mime = "application/x-bzip2", fg = "#f5c2e7" }, + { mime = "application/x-7z-compressed", fg = "#f5c2e7" }, + { mime = "application/x-rar", fg = "#f5c2e7" }, + + # Fallback + { name = "*", fg = "#cdd6f4" }, + { name = "*/", fg = "#89b4fa" } +] + +# : }}} diff --git a/yazi/yazi.toml b/yazi/yazi.toml index 239ad44..028a2ce 100644 --- a/yazi/yazi.toml +++ b/yazi/yazi.toml @@ -1,72 +1,66 @@ [manager] -layout = [ 1, 4, 3 ] -sort_by = "modified" +layout = [1, 4, 3] +sort_by = "modified" sort_sensitive = true -sort_reverse = true +sort_reverse = true sort_dir_first = true -show_hidden = false -show_symlink = true +show_hidden = false +show_symlink = true [preview] -tab_size = 2 -max_width = 600 +tab_size = 2 +max_width = 600 max_height = 900 -cache_dir = "" +cache_dir = "" [opener] folder = [ - { exec = 'open -R "$@"', orphan = true, display_name = "Reveal in Finder" }, - { exec = '$EDITOR "$@"', orphan = true }, -] -archive = [ - { exec = 'unar "$1"', display_name = "Extract here" }, -] -text = [ - { exec = '$EDITOR "$@"', orphan = true }, + { run = 'open -R "$@"', orphan = true, display_name = "Reveal in Finder" }, + { run = '$EDITOR "$@"', orphan = true }, ] +archive = [{ run = 'unar "$1"', display_name = "Extract here" }] +text = [{ run = '$EDITOR "$@"', orphan = true }] image = [ - { exec = 'imv "$@"', orphan = true, display_name = "Open" }, - { exec = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show EXIF" }, -] -pdf = [ - { exec = 'zathura "$@"', orphan = true, display_name = "Open" }, + { run = 'imv "$@"', orphan = true, display_name = "Open" }, + { run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show EXIF" }, ] +pdf = [{ run = 'zathura "$@"', orphan = true, display_name = "Open" }] video = [ - { exec = 'mpv "$@"', orphan = true }, - { exec = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" }, + { run = 'mpv "$@"', orphan = true }, + { run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" }, ] audio = [ - { exec = 'xdg-open "$@"', orphan = true }, - { exec = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" }, + { run = 'xdg-open "$@"', orphan = true }, + { run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" }, ] fallback = [ - { exec = 'xdg-open "$@"', orphan = true, display_name = "Open" }, - { exec = 'xdg-open -R "$@"', orphan = true, display_name = "Reveal in Finder" }, + { run = 'xdg-open "$@"', orphan = true, display_name = "Open" }, + { run = 'xdg-open -R "$@"', orphan = true, display_name = "Reveal in Finder" }, ] [open] rules = [ - { name = "*/", use = "folder" }, + { name = "*/", use = "folder" }, - { mime = "text/*", use = "text" }, - { mime = "image/*", use = "image" }, - { mime = "application/pdf", use = "pdf" }, - { mime = "video/*", use = "video" }, - { mime = "audio/*", use = "audio" }, - { mime = "inode/x-empty", use = "text" }, + { mime = "text/*", use = "text" }, + { mime = "image/*", use = "image" }, + { mime = "application/pdf", use = "pdf" }, + { mime = "video/*", use = "video" }, + { mime = "audio/*", use = "audio" }, + { mime = "inode/x-empty", use = "text" }, - { mime = "application/json", use = "text" }, - { mime = "*/javascript", use = "text" }, + { mime = "application/json", use = "text" }, + { mime = "*/javascript", use = "text" }, - { mime = "application/zip", use = "archive" }, - { mime = "application/gzip", use = "archive" }, - { mime = "application/x-tar", use = "archive" }, - { mime = "application/x-bzip", use = "archive" }, - { mime = "application/x-bzip2", use = "archive" }, - { mime = "application/x-7z-compressed", use = "archive" }, - { mime = "application/x-rar", use = "archive" }, + { mime = "application/zip", use = "archive" }, + { mime = "application/gzip", use = "archive" }, + { mime = "application/x-tar", use = "archive" }, + { mime = "application/x-bzip", use = "archive" }, + { mime = "application/x-bzip2", use = "archive" }, + { mime = "application/x-7z-compressed", use = "archive" }, + { mime = "application/x-rar", use = "archive" }, - { mime = "*", use = "fallback" }, + { mime = "*", use = "fallback" }, ] [tasks] @@ -76,3 +70,9 @@ bizarre_retry = 5 [log] enabled = false + +[plugin] +prepend_previewers = [ + { name = "*.md", run = "glow" }, + { mime = "text/csv", run = "miller" }, +]