nvim/lua/plugins.lua
2025-11-05 19:29:55 +01:00

589 lines
16 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local plugins = {
{
'nvim-treesitter/nvim-treesitter',
config = function()
require 'nvim-treesitter.configs'.setup {
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
enable = true,
disable = { "csv" },
},
}
require('configs.treesitter')
end,
},
{
"neovim/nvim-lspconfig",
config = function()
require("configs.lspconfig")
end
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
opts = {
background = {
light = "latte",
dark = "mocha",
},
color_overrides = {
mocha = {
base = "#000000",
text = "#ffffff",
mantle = "#111111",
crust = "#111111",
},
latte = {
base = "#ffffff",
text = "#000000",
mantle = "#f5f5f5",
crust = "#f5f5f5",
black = "#000000",
}
},
custom_highlights = require("colors.quasimono"),
integrations = {
semantic_tokens = false,
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = false,
mini = true,
mason = true,
neogit = true,
illuminate = false,
-- noice = true,
-- notify = true,
flash = true,
telescope = {
enabled = true,
style = "nvchad"
},
dap = {
enabled = true,
enable_ui = true, -- enable nvim-dap-ui
},
indent_blankline = {
enabled = true,
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
inlay_hints = {
background = true,
},
},
},
}
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
-- cmp sources plugins
{
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
{
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets",
},
init = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()
end
},
'saadparwaiz1/cmp_luasnip'
},
},
config = function()
return require "configs.cmp"
end,
},
{
"zbirenbaum/copilot.lua",
cmd = { "Copilot" },
opts = {
suggestion = {
auto_trigger = true,
},
filetypes = {
markdown = true,
},
},
},
{
'nvim-lualine/lualine.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
{ 'linrongbin16/lsp-progress.nvim', opts = {} }
},
opts = require("configs.lualine")
},
{
'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function()
vim.g.barbar_auto_setup = false
end,
opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true,
icons = {
-- Configure the base icons on the bufferline.
-- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
buffer_index = false,
buffer_number = false,
gitsigns = {
added = { enabled = false, icon = '+' },
changed = { enabled = false, icon = '~' },
deleted = { enabled = false, icon = '-' },
},
filetype = {
-- Sets the icon's highlight group.
-- If false, will use nvim-web-devicons colors
custom_colors = false,
-- Requires `nvim-web-devicons` if `true`
enabled = false,
},
separator = { left = '', right = '' },
-- If true, add an additional separator at the end of the buffer list
separator_at_end = true,
-- Configure the icons on the bufferline when modified or pinned.
-- Supports all the base icon options.
modified = { button = '' },
pinned = { button = '', filename = true },
-- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted'
preset = 'default',
-- Configure the icons on the bufferline based on the visibility of a buffer.
-- Supports all the base icon options, plus `modified` and `pinned`.
alternate = { filetype = { enabled = false } },
current = { buffer_index = false },
inactive = { button = '×' },
visible = { modified = { buffer_number = false } },
},
-- …etc.
},
version = '^1.0.0', -- optional: only update when a new 1.x version is released
},
{
'numToStr/Comment.nvim',
opts = {}
},
{
'Wansmer/treesj',
keys = { '<space>m', '<space>j', '<space>s' },
dependencies = { 'nvim-treesitter/nvim-treesitter' },
opts = {
use_default_keymaps = false,
max_join_length = 36000,
},
},
{
"rmagatti/auto-session",
config = function()
require("auto-session").setup({
log_level = "error",
pre_save_cmds = {
function()
vim.api.nvim_exec_autocmds('User', {pattern = 'SessionSavePre'})
end
},
post_restore_cmds = {
function()
end
},
pre_delete_cmds = {
},
})
end,
},
{
"ethanholz/nvim-lastplace",
config = function()
require("nvim-lastplace").setup()
end,
},
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
},
{
'echasnovski/mini.files',
version = false,
config = function()
require('mini.files').setup()
end,
},
{
"lewis6991/gitsigns.nvim",
config = function()
require('gitsigns').setup({
word_diff = true,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, { expr = true })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, { expr = true })
-- Actions
map('n', '<leader>hs', gs.stage_hunk, { desc = "Stage hunk" })
map('n', '<leader>hr', gs.reset_hunk, { desc = "Reset hunk" })
map('v', '<leader>hs', function()
gs.stage_hunk { vim.fn.line(
'.'
), vim.fn.line('v') }
end,
{ desc = "Stage hunk" })
map(
'v',
'<leader>hr',
function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
{ desc = "Reset hunk" }
)
map('n', '<leader>hS', gs.stage_buffer, { desc = "Stage buffer" })
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = "Undo stage hunk" })
map('n', '<leader>hR', gs.reset_buffer, { desc = "Reset buffer" })
map('n', '<leader>hp', gs.preview_hunk, { desc = "Preview hunk" })
map(
'n',
'<leader>hb',
function() gs.blame_line { full = true } end,
{ desc = "Blame line" }
)
map('n', '<leader>hB', gs.blame, { desc = "Blame" })
map(
'n',
'<leader>tb',
gs.toggle_current_line_blame,
{ desc = "Toggle current line blame" }
)
map('n', '<leader>hd', gs.diffthis, { desc = "Diff this" })
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = "Diff this (ignore whitespace)" })
map('n', '<leader>td', gs.toggle_deleted, { desc = "Toggle deleted" })
-- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = "Select hunk" })
end
})
end,
},
{
"sustech-data/wildfire.nvim",
event = "VeryLazy",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
keymaps = {
init_selection = "<space>",
node_incremental = "<space>",
node_decremental = "<c-space>",
}
}
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = function()
return {
scope = {
show_start = false,
show_end = false,
},
}
end,
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
opts = {}
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"nvim-telescope/telescope.nvim", -- optional
"ibhagwan/fzf-lua", -- optional
},
config = function()
require("neogit").setup({
sections = {
untracked = {
folded = true,
}
},
mappings = {
status = {
["S"] = "Stage",
["<S-S>"] = "Stage",
["<C-S>"] = "Stage",
}
}
})
vim.api.nvim_create_autocmd("User", {
pattern = "NeogitStatusRefreshed",
callback = function()
vim.cmd("set autoread | checktime")
end
})
end
},
{
"RRethy/vim-illuminate",
config = function()
require('illuminate').configure({
providers = {
'lsp',
},
delay = 100,
})
end
},
{ "ofseed/lualine-copilot" },
{
'smoka7/hop.nvim',
version = "*",
opts = {
uppercase_labels = true,
},
},
{
'eandrju/cellular-automaton.nvim'
},
{
"kawre/leetcode.nvim",
build = ":TSUpdate html",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim", -- required by telescope
"MunifTanjim/nui.nvim",
-- optional
"nvim-treesitter/nvim-treesitter",
-- "rcarriga/nvim-notify",
"nvim-tree/nvim-web-devicons",
},
opts = {
-- configuration goes here
--
lang = "c",
description = {
position = "right"
}
},
},
{
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
opts = {
controls = {
enabled = false,
},
}
},
{
"mfussenegger/nvim-dap",
config = function()
require("configs.dap")
end
},
{ "nvim-neotest/nvim-nio" },
{
"theHamsta/nvim-dap-virtual-text",
lazy = false,
dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" },
opts = {
virt_text_pos = 'eol'
}
},
{
'echasnovski/mini.align',
version = false,
opts = {
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
start_with_preview = 'ga',
},
},
},
{
"brenton-leighton/multiple-cursors.nvim",
version = "*", -- Use the latest tagged version
opts = {}, -- This causes the plugin setup function to be called
keys = {
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i" } },
{ "<C-j>", "<Cmd>MultipleCursorsAddDown<CR>" },
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i" } },
{ "<C-k>", "<Cmd>MultipleCursorsAddUp<CR>" },
{ "<C-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
{ "<Leader>a", "<Cmd>MultipleCursorsJumpNextMatch<CR>", mode = { "n", "x" } },
{ "<Leader>A", "<Cmd>MultipleCursorsAddMatchesV<CR>", mode = { "n", "x" } },
-- { "<Leader>d", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
-- { "<Leader>D", "<Cmd>MultipleCursorsJumpNextMatch<CR>" },
},
},
{
'stevearc/conform.nvim',
config = function()
require("conform").setup({
formatters = {
uncrustify = {
prepend_args = { "-c", "./scripts/uncrustify.cfg" },
},
["clang-format"] = {
prepend_args = {
"--style", "file:" .. vim.fn.expand("~/clang-format.yaml")
},
}
},
formatters_by_ft = {
cpp = { "uncrustify" },
c = { "uncrustify" },
typst = { "typstyle" }
}
})
vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_format = "fallback", range = range })
end, { range = true })
-- vim.api.nvim_create_user_command("FormatClang", function(args)
-- local range = nil
-- if args.count ~= -1 then
-- local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
-- range = {
-- start = { args.line1, 0 },
-- ["end"] = { args.line2, end_line:len() },
-- }
-- end
-- require("conform").format({ formatters = { "clang-format" }, range = range })
-- end, { range = true })
--
-- vim.keymap.set({"v"}, "<leader>fl", ":FormatClang<cr>", { desc = "Format with clang"})
end
},
{
"chentoast/marks.nvim",
opts = {},
},
{
'nvim-treesitter/nvim-treesitter-context',
config = function()
require 'treesitter-context'.setup {
multiline_threshold = 1,
}
end
},
{
'jakemason/ouroboros',
dependencies = { "nvim-lua/plenary.nvim" }
},
{
"folke/trouble.nvim",
config = function () require("trouble").setup() end,
cmd = "Trouble",
},
{
"andrewradev/linediff.vim",
config = function()
vim.keymap.set({ "n", "v" }, "<leader>d", ":Linediff <cr>", { desc = "Linediff" })
end
},
{
"luc-tielen/telescope_hoogle",
config = function ()
local telescope = require('telescope')
-- telescope.setup {
-- -- opts...
-- }
telescope.load_extension('hoogle')
end,
dependencies = {
"nvim-telescope/telescope.nvim"
}
},
{
'fredeeb/tardis.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function ()
require('tardis-nvim').setup {
keymap = {
["next"] = '<C-j>', -- next entry in log (older)
["prev"] = '<C-k>', -- previous entry in log (newer)
["quit"] = 'q', -- quit all
["revision_message"] = '<C-m>', -- show revision message for current revision
["commit"] = '<C-g>', -- replace contents of origin buffer with contents of tardis buffer
},
initial_revisions = 10, -- initial revisions to create buffers for
max_revisions = 256, -- max number of revisions to load
}
end
},
{
'BartSte/nvim-project-marks',
lazy = false,
config = function()
require('projectmarks').setup({})
end
},
}
return plugins