diff --git a/nvim/.config/nvim/lua/plugins/core.lua b/nvim/.config/nvim/lua/plugins/core.lua index 4951e6e..5579dbd 100644 --- a/nvim/.config/nvim/lua/plugins/core.lua +++ b/nvim/.config/nvim/lua/plugins/core.lua @@ -107,8 +107,27 @@ return { }) require("mini.ai").setup() - -- Align tables and other alignable things + -- Align tables and other alignable things require("mini.align").setup({}) + + require("mini.bracketed").setup({ + { + buffer = { suffix = "b", options = {} }, + comment = { suffix = "c", options = {} }, + conflict = { suffix = "", options = {} }, + diagnostic = { suffix = "d", options = {} }, + file = { suffix = "f", options = {} }, + indent = { suffix = "", options = {} }, -- disable since we use indentscope above + jump = { suffix = "j", options = {} }, + location = { suffix = "l", options = {} }, + oldfile = { suffix = "o", options = {} }, + quickfix = { suffix = "q", options = {} }, + treesitter = { suffix = "t", options = {} }, + undo = { suffix = "", options = {} }, -- disable since I don't need it + window = { suffix = "w", options = {} }, + yank = { suffix = "y", options = {} }, + }, + }) require("mini.comment").setup({ hooks = { pre = function() @@ -119,9 +138,19 @@ return { end, }, }) + require("mini.cursorword").setup({ delay = 500 }) vim.api.nvim_set_hl(0, "MiniCursorword", { bold = true, underline = false }) vim.api.nvim_set_hl(0, "MiniCursorwordCurrent", { bold = true, underline = false }) + + require("mini.files").setup() + vim.api.nvim_create_autocmd("User", { + pattern = "MiniFilesWindowUpdate", + callback = function(args) + vim.wo[args.data.win_id].number = true + end, + }) + require("mini.fuzzy").setup() require("mini.indentscope").setup({ symbol = "│", @@ -150,24 +179,6 @@ return { starter.gen_hook.aligning("center", "center"), }, }) - require("mini.bracketed").setup({ - { - buffer = { suffix = "b", options = {} }, - comment = { suffix = "c", options = {} }, - conflict = { suffix = "", options = {} }, - diagnostic = { suffix = "d", options = {} }, - file = { suffix = "f", options = {} }, - indent = { suffix = "", options = {} }, -- disable since we use indentscope above - jump = { suffix = "j", options = {} }, - location = { suffix = "l", options = {} }, - oldfile = { suffix = "o", options = {} }, - quickfix = { suffix = "q", options = {} }, - treesitter = { suffix = "t", options = {} }, - undo = { suffix = "", options = {} }, -- disable since I don't need it - window = { suffix = "w", options = {} }, - yank = { suffix = "y", options = {} }, - }, - }) end, event = "VimEnter", -- need to load pretty soon for Starter screen keys = { @@ -176,14 +187,16 @@ return { function() require("mini.map").toggle() end, - silent = true, desc = "minimap" , + silent = true, + desc = "minimap", }, { "ss", function() require("mini.starter").open() end, - silent = true, desc = "startpage" , + silent = true, + desc = "startpage", }, { "w", @@ -192,6 +205,16 @@ return { end, desc = "Trim trailing whitespace", }, + { + "e", + function() + local mf = require("mini.files") + if not mf.close() then + mf.open() + end + end, + desc = "floating file browser", + }, }, }, -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, .. diff --git a/nvim/.config/nvim/lua/plugins/filebrowsers.lua b/nvim/.config/nvim/lua/plugins/filebrowsers.lua index 411f81b..b26f4c8 100644 --- a/nvim/.config/nvim/lua/plugins/filebrowsers.lua +++ b/nvim/.config/nvim/lua/plugins/filebrowsers.lua @@ -9,9 +9,8 @@ return { end, cmd = "Vifm", keys = { - { "e", "Vifm", desc = "browse files" }, - { "E", ":Vifm getcwd()", desc = "browse project" }, - { "vc", ":Vifm " .. vim.fn.stdpath("config") .. "/lua", desc = "open config" }, + { "E", "Vifm", desc = "buffer file browser" }, + { "vc", ":Vifm " .. vim.fn.stdpath("config") .. "", desc = "open config" }, }, event = { "BufEnter" }, }, -- integrate file manager