Files
nvim-modular/lua/kickstart/plugins/mini.lua
2025-08-09 01:26:55 +02:00

98 lines
3.5 KiB
Lua

-- mini
-- https://github.com/echasnovski/mini.nvim
return {
{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
version = false,
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
local starter = require 'mini.starter'
local logo = require 'kickstart.plugins.logos'
starter.setup {
evaluate_single = true,
header = table.concat(logo.neovim1, '\n'),
items = {
{ action = 'edit ~/.config/nvim/init.lua', name = ' Configuration', section = 'Configuration' },
{ action = 'Telescope find_files', name = '󰱼 Rechercher fichier', section = 'Telescope' },
{ action = 'Telescope oldfiles', name = '󰋚 Fichiers récents', section = 'Telescope' },
{ action = 'Telescope live_grep', name = '󰱼 Rechercher texte', section = 'Telescope' },
{ action = 'e .', name = ' Ouvrir', section = 'Fichiers' },
{ action = 'qa', name = '󰗼 Quitter', section = 'Quitter' },
},
content_hooks = {
require('mini.starter').gen_hook.adding_bullet '󰐊 ',
require('mini.starter').gen_hook.aligning('center', 'center'),
},
}
-- Simple way to visualize and work with indent scope
local indentscope = require 'mini.indentscope'
indentscope.setup {}
-- Simple way to (un)comment line(s)
local commenter = require 'mini.comment'
commenter.setup {
mappings = {
comment = '<leader>c',
comment_line = '<leader>cl',
comment_visual = '<leader>c',
textobject = '<leader>c',
},
}
-- Minimal and fast tabline showing listed buffers
local tabline = require 'mini.tabline'
tabline.setup {}
-- Work with trailing whitespace
local trailspace = require 'mini.trailspace'
trailspace.setup {}
-- Highlight word under cursor
local cursorword = require 'mini.cursorword'
cursorword.setup {}
-- Animate common Neovim actions
local animate = require 'mini.animate'
animate.setup {}
-- Buffer removing (unshow, delete, wipeout), which saves window layout
local bufremove = require 'mini.bufremove'
bufremove.setup {}
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
}