93 lines
2.5 KiB
Lua
93 lines
2.5 KiB
Lua
-- Editor enhancement plugins
|
|
return {
|
|
-- Detect tabstop and shiftwidth automatically (removed guess-indent.nvim duplicate)
|
|
'tpope/vim-sleuth',
|
|
|
|
-- Highlight TODOs in comments
|
|
{
|
|
'folke/todo-comments.nvim',
|
|
event = 'VimEnter',
|
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
opts = { signs = false },
|
|
},
|
|
|
|
-- Collection of mini plugins
|
|
{
|
|
'echasnovski/mini.nvim',
|
|
config = function()
|
|
-- Better Around/Inside textobjects
|
|
require('mini.ai').setup { n_lines = 500 }
|
|
|
|
-- Add/delete/replace surroundings
|
|
require('mini.surround').setup()
|
|
|
|
-- Simple statusline
|
|
local statusline = require 'mini.statusline'
|
|
statusline.setup { use_icons = vim.g.have_nerd_font }
|
|
|
|
---@diagnostic disable-next-line: duplicate-set-field
|
|
statusline.section_location = function()
|
|
return '%2l:%-2v'
|
|
end
|
|
|
|
-- File navigator
|
|
require('mini.files').setup()
|
|
end,
|
|
keys = {
|
|
{ '<leader>ff', '<cmd>lua MiniFiles.open()<cr>', desc = 'Toggle file navigator' },
|
|
},
|
|
},
|
|
|
|
-- Autopairs
|
|
{
|
|
'windwp/nvim-autopairs',
|
|
event = 'InsertEnter',
|
|
dependencies = { 'hrsh7th/nvim-cmp' },
|
|
config = function()
|
|
require('nvim-autopairs').setup {}
|
|
end,
|
|
},
|
|
|
|
-- Diagnostics list
|
|
{
|
|
'folke/trouble.nvim',
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
opts = {},
|
|
keys = {
|
|
{ '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', desc = 'Diagnostics (Trouble)' },
|
|
{ '<leader>xw', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', desc = 'Buffer Diagnostics (Trouble)' },
|
|
{ '<leader>xq', '<cmd>Trouble qflist toggle<cr>', desc = 'Quickfix List (Trouble)' },
|
|
{ '<leader>xl', '<cmd>Trouble loclist toggle<cr>', desc = 'Location List (Trouble)' },
|
|
{ 'gR', '<cmd>Trouble lsp_references toggle<cr>', desc = 'LSP References (Trouble)' },
|
|
},
|
|
},
|
|
|
|
-- Linting
|
|
{
|
|
'mfussenegger/nvim-lint',
|
|
event = { 'BufReadPre', 'BufNewFile' },
|
|
config = function()
|
|
local lint = require 'lint'
|
|
lint.linters_by_ft = {
|
|
-- Add linters per filetype as needed
|
|
}
|
|
|
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
|
group = vim.api.nvim_create_augroup('lint', { clear = true }),
|
|
callback = function()
|
|
if vim.opt_local.modifiable:get() then
|
|
lint.try_lint()
|
|
end
|
|
end,
|
|
})
|
|
end,
|
|
},
|
|
|
|
-- Indentation guides
|
|
{
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
main = 'ibl',
|
|
opts = {},
|
|
},
|
|
}
|