From 786c325e23c11a862d411583e8b9f83e4fe5f776 Mon Sep 17 00:00:00 2001 From: voidarclabs Date: Tue, 29 Jul 2025 12:50:18 +0100 Subject: [PATCH] mini.nvim shenanigans lol --- init.lua | 8 +++++--- lua/plugins/floatterm.lua | 3 --- lua/plugins/mini.lua | 37 +++++++++++++++++++++++++++++++++++++ lua/plugins/snacks.lua | 5 +++-- 4 files changed, 45 insertions(+), 8 deletions(-) delete mode 100644 lua/plugins/floatterm.lua diff --git a/init.lua b/init.lua index e618fee..892eab4 100644 --- a/init.lua +++ b/init.lua @@ -2,9 +2,10 @@ vim.g.mapleader = "" require("config.lazy") +vim.opt.splitbelow = true + vim.cmd.colorscheme("catppuccin-mocha") -vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.cursorline = true @@ -23,10 +24,11 @@ vim.keymap.set("n", "wd", "lua Snacks.dashboard()") vim.keymap.set("n", "l", "bnext") vim.keymap.set("n", "h", "bprev") vim.keymap.set("n", "j", "lua MiniFiles.open()") -vim.keymap.set("n", "f", "lua Snacks.picker.files()") +vim.keymap.set("n", "f", "Pick files") +vim.keymap.set("n", "g", "Pick grep_live") vim.keymap.set("n", "u", "UndotreeToggleUndotreeFocus") -vim.keymap.set("n", "k", "FloatermNew lazygit") +vim.keymap.set("n", "k", "lua Snacks.lazygit()") vim.keymap.set("n", "x", "FloatermKill") vim.keymap.set("i", "jj", "") diff --git a/lua/plugins/floatterm.lua b/lua/plugins/floatterm.lua deleted file mode 100644 index af1d821..0000000 --- a/lua/plugins/floatterm.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'voldikss/vim-floaterm', -} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 2df363c..bb20d1f 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -16,5 +16,42 @@ return { }, }) require("mini.notify").setup() + require("mini.move").setup({ + mappings = { + down = "J", + up = "K", + }, + }) + require("mini.surround").setup({ + mappings = { + add = "sa", + delete = "sd", -- Delete surrounding + find = "sf", -- Find surrounding (to the right) + find_left = "sF", -- Find surrounding (to the left) + highlight = "sh", -- Highlight surrounding + replace = "sr", -- Replace surrounding + update_n_lines = "sn", -- Update `n_lines` + }, + }) + require("mini.ai").setup({ + mappings = { + -- Main textobject prefixes + around = "a", + inside = "i", + + -- Next/last variants + -- NOTE: These override built-in LSP selection mappings on Neovim>=0.12 + -- Map LSP selection manually to use it (see `:h MiniAi.config`) + around_next = "an", + inside_next = "in", + around_last = "al", + inside_last = "il", + + -- Move cursor to corresponding edge of `a` textobject + goto_left = "g[", + goto_right = "g]", + }, + }) + require("mini.pick").setup({})("test") end, } diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index 58fdd23..2243d7b 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -4,6 +4,7 @@ return { lazy = false, ---@type snacks.Config opts = { + lazygit = { enabled = true }, bigfile = { enabled = true }, picker = {}, @@ -12,13 +13,13 @@ return { width = 100, preset = { keys = { - { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "f", desc = "Find File", action = ":Pick files" }, { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, { icon = " ", key = "g", desc = "Find Text", - action = ":lua Snacks.dashboard.pick('live_grep')", + action = ":Pick live_grep", }, { icon = " ",