73 lines
2.9 KiB
Lua
73 lines
2.9 KiB
Lua
-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
|
|
local path_package = vim.fn.stdpath('data') .. '/site/'
|
|
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
|
|
if not (vim.uv or vim.loop).fs_stat(mini_path) then
|
|
vim.cmd('echo "Installing [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
|
|
local clone_cmd = {
|
|
'git', 'clone', '--filter=blob:none',
|
|
'https://github.com/nvim-mini/mini.nvim', mini_path
|
|
}
|
|
vim.fn.system(clone_cmd)
|
|
vim.cmd('packadd mini.nvim | helptags ALL')
|
|
vim.cmd('echo "Installed [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
|
|
end
|
|
require('mini.deps').setup({ path = { package = path_package } })
|
|
|
|
require('mini.ai').setup() -- enhances the use of a/i textobjects
|
|
require('mini.align').setup() -- utility to align text in various ways
|
|
require('mini.comment').setup() -- for toggling comments inline
|
|
require('mini.move').setup() -- moving lines
|
|
require('mini.operators').setup() -- duplicating lines and evaluating equations inline
|
|
require('mini.surround').setup() -- surround stuff
|
|
require('mini.diff').setup({ -- shows git diffs in the file
|
|
view = {
|
|
style = 'sign',
|
|
}
|
|
})
|
|
require('mini.jump').setup() -- extends f,F,t,T to work across multiple lines
|
|
require('mini.cursorword').setup() -- highlight words beneath the cursor
|
|
require('mini.indentscope').setup({
|
|
draw = {
|
|
delay = 50, -- delay in MS before writing the indicator
|
|
animation = require('mini.indentscope').gen_animation.none(),
|
|
},
|
|
})
|
|
MiniDeps.later(function()
|
|
vim.api.nvim_set_hl(0, 'MiniIndentscopeSymbol', { link = 'Whitespace' })
|
|
end)
|
|
require('mini.notify').setup() -- has more noticeable / utilitarian / aesthetically pleasing notifications
|
|
require('mini.statusline').setup({
|
|
content = {
|
|
active = function()
|
|
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
|
local git = MiniStatusline.section_git({ trunc_width = 40 })
|
|
local diff = MiniStatusline.section_diff({ trunc_width = 75 })
|
|
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
|
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
|
|
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
|
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
|
|
|
return MiniStatusline.combine_groups({
|
|
{ hl = mode_hl, strings = { mode } },
|
|
{ hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } },
|
|
'%<', -- general truncation point
|
|
{ hl = 'MiniStatuslineFilename', strings = { filename } },
|
|
'%=', -- align right
|
|
{ hl = 'MiniStatuslineFileInfo', strings = { fileinfo } },
|
|
{ hl = mode_hl, strings = { '%3l:%-3c' } }
|
|
})
|
|
end,
|
|
inactive = function()
|
|
return MiniStatusline.combine_groups({
|
|
{},
|
|
})
|
|
end
|
|
},
|
|
use_icons = true,
|
|
set_vim_settings = true,
|
|
})
|
|
|
|
---@module 'lazy'
|
|
---@type LazySpec
|
|
return {}
|