neovim-confs/lua/custom/plugins.lua

251 lines
7.6 KiB
Lua
Raw Normal View History

2024-01-19 22:34:37 +01:00
local overrides = require "custom.configs.overrides"
local utils = require "core.utils"
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason,
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
{
"stevearc/conform.nvim",
-- for users those who want auto-save conform + lazyloading!
-- event = "BufWritePre"
config = function()
require "custom.configs.conform"
end,
},
{
"ggandor/leap.nvim",
2024-01-19 23:13:23 +01:00
lazy = false,
2024-01-19 22:34:37 +01:00
config = function()
2024-01-19 23:13:23 +01:00
require("core.utils").load_mappings "leap"
end,
},
{
"ggandor/flit.nvim",
lazy = false,
config = function()
require("flit").setup {
keys = { f = "f", F = "F", t = "t", T = "T" },
-- A string like "nv", "nvo", "o", etc.
labeled_modes = "v",
multiline = true,
-- Like `leap`s similar argument (call-specific overrides).
-- E.g.: opts = { equivalence_classes = {} }
opts = {},
}
2024-01-19 22:34:37 +01:00
end,
},
{
"kdheepak/lazygit.nvim",
2024-01-19 23:13:23 +01:00
lazy = false,
2024-01-19 22:34:37 +01:00
keys = { "<leader>gg" },
cmd = "LazyGit",
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
init = function()
require("core.utils").load_mappings "lazygit"
end,
},
{
"folke/which-key.nvim",
keys = { "<leader>", "<localleader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
2024-01-20 03:03:39 +01:00
defaults = {
mode = { "n", "v" },
[";"] = { name = "+telescope" },
[";f"] = { name = "+find" },
[";d"] = { name = "+lsp/todo" },
["g"] = { name = "+goto" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>c"] = { name = "+code" },
["<leader>g"] = { name = "+git" },
["<leader>t"] = { name = "+toggle/tools" },
["<leader>w"] = { name = "+window/which" },
["<leader>f"] = { name = "+formatting" },
},
2024-01-19 22:34:37 +01:00
},
2024-01-20 00:37:13 +01:00
{ "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} },
2024-01-20 03:03:39 +01:00
{
"RRethy/vim-illuminate",
lazy = false,
event = { "BufReadPost", "BufNewFile" },
opts = {
delay = 200,
under_cursor = false,
modes_allowlist = { "n", "no", "nt" },
filetypes_denylist = {
"DiffviewFileHistory",
"DiffviewFiles",
"SidebarNvim",
"fugitive",
"git",
"minifiles",
"neo-tree",
},
},
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, {
desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference",
buffer = buffer,
})
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("plex_illuminate", {}),
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
},
{
"folke/todo-comments.nvim",
lazy = false,
dependencies = "nvim-telescope/telescope.nvim",
-- stylua: ignore
keys = {
{ ']t', function() require('todo-comments').jump_next() end, desc = 'Next todo comment' },
{ '[t', function() require('todo-comments').jump_prev() end, desc = 'Previous todo comment' },
{ '<LocalLeader>dt', '<cmd>TodoTelescope<CR>', desc = 'todo' },
{ '<leader>xt', '<cmd>TodoTrouble<CR>', desc = 'Todo (Trouble)' },
{ '<leader>xT', '<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>', desc = 'Todo/Fix/Fixme (Trouble)' },
},
opts = {
signs = true,
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
SECURITY = { icon = "󰒃 ", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
},
},
{
"folke/trouble.nvim",
cmd = { "Trouble", "TroubleToggle" },
opts = { use_diagnostic_signs = true },
-- stylua: ignore
keys = {
{
'<leader>e',
'<cmd>TroubleToggle document_diagnostics<CR>',
noremap = true,
desc =
'Document Diagnostics'
},
{
'<leader>r',
'<cmd>TroubleToggle workspace_diagnostics<CR>',
noremap = true,
desc =
'Workspace Diagnostics'
},
{ '<leader>xx', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Document Diagnostics (Trouble)' },
{ '<leader>xX', '<cmd>TroubleToggle workspace_diagnostics<cr>', desc = 'Workspace Diagnostics (Trouble)' },
{ '<leader>xQ', '<cmd>TroubleToggle quickfix<cr>', desc = 'Quickfix List (Trouble)' },
{ '<leader>xL', '<cmd>TroubleToggle loclist<cr>', desc = 'Location List (Trouble)' },
{
'[q',
function()
if require('trouble').is_open() then
require('trouble').previous({ skip_groups = true, jump = true })
else
vim.cmd.cprev()
end
end,
desc = 'Previous trouble/quickfix item',
},
{
']q',
function()
if require('trouble').is_open() then
require('trouble').next({ skip_groups = true, jump = true })
else
vim.cmd.cnext()
end
end,
desc = 'Next trouble/quickfix item',
},
},
},
2024-01-20 04:05:27 +01:00
{
"NvChad/nvterm",
enabled = false,
},
{
"akinsho/toggleterm.nvim",
init = function ()
require("core.utils").load_mappings "toggleterm"
end,
cmd = "ToggleTerm",
opts = {
open_mapping = false,
float_opts = {
border = "curved",
},
},
},
2024-01-19 22:34:37 +01:00
}
return plugins