diff --git a/lazy-lock.json b/lazy-lock.json index bfeb55c..d505799 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,8 @@ { "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, - "NvChad": { "branch": "v2.5", "commit": "c57b82473b821274f6017eb03582ba1d13be9d8c" }, + "NvChad": { "branch": "v2.5", "commit": "f437558f23c8f50c36cd09748121ab2c822e8ec9" }, "actions-preview.nvim": { "branch": "master", "commit": "cb938c25edaac38d362555f19244a9cb85d561e8" }, + "baleia.nvim": { "branch": "main", "commit": "32617940adb2eea56e85a64883a19961ceac9641" }, "base46": { "branch": "v3.0", "commit": "884b990dcdbe07520a0892da6ba3e8d202b46337" }, "cmp-async-path": { "branch": "main", "commit": "f8af3f726e07f2e9d37672eaa9102581aefce149" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, @@ -11,37 +12,37 @@ "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "fzf-lua": { "branch": "main", "commit": "c9e07380df2826c63a8ae396559872b2553c22bc" }, + "fzf-lua": { "branch": "main", "commit": "9004cbb4c065a32b690e909c49903967b45301eb" }, "git-conflict.nvim": { "branch": "main", "commit": "a1badcd070d176172940eb55d9d59029dad1c5a6" }, - "gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" }, + "gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" }, "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, - "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "mdx.nvim": { "branch": "main", "commit": "30222997ed4c0c7cc7447c4fce360fce87101bbf" }, "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, - "mini.files": { "branch": "main", "commit": "fafacfecdd6c5a66bb10d173a749f3c098e84498" }, + "mini.files": { "branch": "main", "commit": "1202e26484c10e9d6190cab3314dd187f871472c" }, "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, - "neogit": { "branch": "master", "commit": "73870229977fdd8747025820e15e98cfde787b9c" }, + "neogit": { "branch": "master", "commit": "d5af26e085a21b468b98c0e1257ac52706c1066f" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "007047febaa3681a8d2f3dd5126fdb9c6e81f393" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, - "nvim-lsp-endhints": { "branch": "main", "commit": "b554a53e8c8a039d48ec5e9e581cb62cd1127dcd" }, - "nvim-lspconfig": { "branch": "master", "commit": "238583bb00770b079c68c69a860d65e5d1d8acf9" }, + "nvim-lsp-endhints": { "branch": "main", "commit": "9b210f760fe8bde5f335f2660ccb2bf19aabad68" }, + "nvim-lspconfig": { "branch": "master", "commit": "5a855bcfec7973767a1a472335684bbd71d2fa2b" }, "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, "nvim-tree.lua": { "branch": "master", "commit": "3fb91e18a727ecc0385637895ec397dea90be42a" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, + "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "ron.vim": { "branch": "master", "commit": "f749e543975a82e8dd9a6e7df9600a1c098ae800" }, "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, "statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "tailwind-tools": { "branch": "master", "commit": "fbe982901d4508b0dcd80e07addf0fcb6dab6c49" }, - "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, "tint.nvim": { "branch": "master", "commit": "586e87f00c8b0f5e857cefe10839e41f3e8c6d01" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, @@ -49,5 +50,6 @@ "ui": { "branch": "v3.0", "commit": "cb75908a86720172594b30de147272c1b3a7f452" }, "vim-kitty": { "branch": "main", "commit": "cd72f2d9cfee8d6aba5a180a5ac3ca265b5d3a46" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, - "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "yazi.nvim": { "branch": "main", "commit": "30531c7283b16134cae28d5217b4341ac9486a06" } } diff --git a/lua/plugins/file-explorer.lua b/lua/plugins/file-explorer.lua index 7949796..27be4ed 100644 --- a/lua/plugins/file-explorer.lua +++ b/lua/plugins/file-explorer.lua @@ -5,138 +5,6 @@ return { }, { "echasnovski/mini.files", - version = false, - keys = { - { - "e", - function() - local MiniFiles = require "mini.files" - if not MiniFiles.close() then - MiniFiles.open(vim.api.nvim_buf_get_name(0)) - end - end, - desc = "File explorer (current file)", - }, - { - "E", - function() - local MiniFiles = require "mini.files" - if not MiniFiles.close() then - MiniFiles.open(vim.uv.cwd()) - end - end, - desc = "File explorer (cwd)", - }, - }, - config = function() - local mf = require "mini.files" - mf.setup { - mappings = { - close = "q", - go_in = "l", - go_in_plus = "", - go_out = "h", - go_out_plus = "H", - reset = "", - reveal_cwd = "@", - show_help = "g?", - synchronize = "=", - trim_left = "<", - trim_right = ">", - }, - windows = { - preview = true, - width_focus = 30, - width_nofocus = 15, - width_preview = 50, - }, - options = { - use_as_default_explorer = true, - }, - } - - -- https://github.com/nvim-mini/mini.nvim/discussions/2173 - -- Window width based on the offset from the center, i.e. center window - -- is 60, then next over is 20, then the rest are 10. - -- Can use more resolution if you want like { 60, 20, 20, 10, 5 } - local widths = { 60, 20, 10 } - - local ensure_center_layout = function(ev) - local state = mf.get_explorer_state() - if state == nil then - return - end - - -- Compute "depth offset" - how many windows are between this and focused - local path_this = vim.api.nvim_buf_get_name(ev.data.buf_id):match "^minifiles://%d+/(.*)$" - local depth_this - for i, path in ipairs(state.branch) do - if path == path_this then - depth_this = i - end - end - if depth_this == nil then - return - end - local depth_offset = depth_this - state.depth_focus - - -- Adjust config of this event's window - local i = math.abs(depth_offset) + 1 - local win_config = vim.api.nvim_win_get_config(ev.data.win_id) - win_config.width = i <= #widths and widths[i] or widths[#widths] - - win_config.col = math.floor(0.5 * (vim.o.columns - widths[1])) - for j = 1, math.abs(depth_offset) do - local sign = depth_offset == 0 and 0 or (depth_offset > 0 and 1 or -1) - -- widths[j+1] for the negative case because we don't want to add the center window's width - local prev_win_width = (sign == -1 and widths[j + 1]) or widths[j] or widths[#widths] - -- Add an extra +2 each step to account for the border width - win_config.col = win_config.col + sign * (prev_win_width + 2) - end - - win_config.height = depth_offset == 0 and 25 or 20 - win_config.row = math.floor(0.5 * (vim.o.lines - win_config.height)) - win_config.border = { "🭽", "▔", "🭾", "▕", "🭿", "▁", "🭼", "▏" } - vim.api.nvim_win_set_config(ev.data.win_id, win_config) - end - - vim.api.nvim_create_autocmd("User", { pattern = "MiniFilesWindowUpdate", callback = ensure_center_layout }) - - -- ability to open in splits - local map_split = function(buf_id, lhs, direction) - local rhs = function() - -- Make new window and set it as target - local cur_target = mf.get_explorer_state().target_window - local new_target = vim.api.nvim_win_call(cur_target, function() - vim.cmd(direction .. " split") - return vim.api.nvim_get_current_win() - end) - - mf.set_target_window(new_target) - - -- This intentionally doesn't act on file under cursor in favor of - -- explicit "go in" action (`l` / `L`). To immediately open file, - -- add appropriate `MiniFiles.go_in()` call instead of this comment. - - mf.go_in() - mf.close() - end - - -- Adding `desc` will result into `show_help` entries - local desc = "Split " .. direction - vim.keymap.set("n", lhs, rhs, { buffer = buf_id, desc = desc }) - end - - vim.api.nvim_create_autocmd("User", { - pattern = "MiniFilesBufferCreate", - callback = function(args) - local buf_id = args.data.buf_id - -- Tweak keys to your liking - map_split(buf_id, "s", "belowright horizontal") - map_split(buf_id, "v", "belowright vertical") - map_split(buf_id, "t", "tab") - end, - }) - end, + enabled = false, }, } diff --git a/lua/plugins/yazi.lua b/lua/plugins/yazi.lua new file mode 100644 index 0000000..e585771 --- /dev/null +++ b/lua/plugins/yazi.lua @@ -0,0 +1,13 @@ +return { + { + "mikavilpas/yazi.nvim", + event = "VeryLazy", + keys = { + { "y", "Yazi", desc = "Open yazi at current file" }, + { "Y", "Yazi cwd", desc = "Open yazi in cwd" }, + }, + opts = { + open_for_directories = false, + }, + }, +}