|
vim.pack.add({ |
|
{ src = 'https://github.com/echasnovski/mini.nvim' } |
|
}) |
|
require("mini.ai").setup({}) -- visual a/i selection |
|
require("mini.align").setup({}) -- align text with ga / gA |
|
require("mini.comment").setup({}) -- improved comments |
|
--require("mini.move").setup({}) -- moves selection up/down/left/right |
|
require("mini.surround").setup({}) -- surround inner outer block with brackets |
|
require("mini.cursorword").setup({}) -- highlight the current word |
|
require("mini.indentscope").setup({}) -- visualize indent |
|
--require("mini.pairs").setup({}) -- adds a matching closing bracket |
|
require("mini.trailspace").setup({}) -- highlight trailing space |
|
require("mini.bufremove").setup({}) -- cleanup windows after buffer is removed |
|
require("mini.notify").setup({}) -- show notifications in floating window |
|
require("mini.icons").setup({}) -- provides icons |
|
require('mini.keymap').setup({}) -- creates multi step key mappings |
|
|
|
-- some nice to have things |
|
require('mini.misc').setup_restore_cursor({ |
|
center = false, -- don't center the window |
|
ignore_filetype = { 'gitcommit', 'gitrebase', 'hgcommit' }, -- add more if you want |
|
}) |
|
|
|
-- status line |
|
require('mini.statusline').setup({ |
|
use_icons = true |
|
}) |
|
|
|
-- add some basic key binds |
|
require("mini.basics").setup({ |
|
options = { |
|
basic = true, -- basic configs (number, ignorecase, etc) |
|
extra_ui = true, -- extra ui features (winblend, listchars, pumheight, etc) |
|
win_borders = 'rounded', -- how popups look |
|
}, |
|
mappings = { |
|
basic = true, -- better jk, etc |
|
option_toggle_prefix = '<leader>t', -- toggling keybinds |
|
windows = false, -- windows mavigation keybinds with ctrl-hjkl |
|
move_with_alt = false, |
|
}, |
|
autocommands = { |
|
basic = true, -- highlight on yank, terminal starts with insert, etc |
|
} |
|
}) |
|
|
|
-- highlight some words |
|
local hip = require("mini.hipatterns") |
|
hip.setup({ |
|
highlighters = { |
|
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' |
|
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" }, |
|
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" }, |
|
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" }, |
|
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" }, |
|
|
|
-- Highlight hex color strings (`#rrggbb`) using that color |
|
hex_color = hip.gen_highlighter.hex_color(), |
|
}, |
|
}) |
|
|
|
-- maps [[ ]] sequences for jumping through blocks |
|
local br = require("mini.bracketed") |
|
br.setup({ |
|
buffer = { suffix = "b", options = {} }, |
|
comment = { suffix = "c", options = {} }, |
|
conflict = { suffix = "x", options = {} }, |
|
diagnostic = { suffix = "" }, -- DISABLED: { suffix = "d", options = {} }, -- prefer the one from lsp-config.lua |
|
file = { suffix = "f", options = {} }, |
|
indent = { suffix = "i", options = {} }, |
|
jump = { suffix = "j", options = {} }, |
|
location = { suffix = "l", options = {} }, |
|
oldfile = { suffix = "o", options = {} }, |
|
quickfix = { suffix = "q", options = {} }, |
|
treesitter = { suffix = "t", options = {} }, |
|
undo = { suffix = "u", options = {} }, |
|
window = { suffix = "w", options = {} }, |
|
yank = { suffix = "y", options = {} }, |
|
|
|
}) |
|
|
|
-- shows list of motions as they are typed |
|
local miniclue = require('mini.clue') |
|
miniclue.setup({ |
|
triggers = { |
|
-- Leader triggers |
|
{ mode = { 'n', 'x' }, keys = '<Leader>' }, |
|
|
|
-- `[` and `]` keys |
|
{ mode = 'n', keys = '[' }, |
|
{ mode = 'n', keys = ']' }, |
|
|
|
-- Built-in completion |
|
{ mode = 'i', keys = '<C-x>' }, |
|
|
|
-- `g` key |
|
{ mode = { 'n', 'x' }, keys = 'g' }, |
|
|
|
-- `s` key -- for mini.surround |
|
{ mode = { 'n', 'x' }, keys = 's' }, |
|
|
|
-- `v` key -- for visual selection |
|
{ mode = { 'v' }, keys = 'a' }, |
|
{ mode = { 'v' }, keys = 'i' }, |
|
{ mode = { 'v' }, keys = 'g' }, |
|
|
|
-- Marks |
|
{ mode = { 'n', 'x' }, keys = "'" }, |
|
{ mode = { 'n', 'x' }, keys = '`' }, |
|
|
|
-- Registers |
|
{ mode = { 'n', 'x' }, keys = '"' }, |
|
{ mode = { 'i', 'c' }, keys = '<C-r>' }, |
|
|
|
-- Window commands |
|
{ mode = 'n', keys = '<C-w>' }, |
|
|
|
-- `z` key |
|
{ mode = { 'n', 'x' }, keys = 'z' }, |
|
}, |
|
|
|
window = { |
|
delay = 0, |
|
config = { |
|
width = 'auto', |
|
border = 'rounded', |
|
}, |
|
}, |
|
|
|
clues = { |
|
-- Enhance this by adding descriptions for <Leader> mapping groups |
|
miniclue.gen_clues.square_brackets(), |
|
miniclue.gen_clues.builtin_completion(), |
|
miniclue.gen_clues.g(), |
|
miniclue.gen_clues.marks(), |
|
miniclue.gen_clues.registers(), |
|
miniclue.gen_clues.windows(), |
|
miniclue.gen_clues.z(), |
|
}, |
|
}) |
|
|
|
local mf = require('mini.files') |
|
vim.keymap.set('n', '<leader>mf', function() |
|
mf.open(vim.api.nvim_buf_get_name(0)) |
|
end, { desc = "Mini files" }) |
|
|