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 = { -- :h background light = "latte", dark = "mocha", }, styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): comments = {}, -- Change the style of comments conditionals = {}, loops = {}, functions = {}, keywords = {}, strings = {}, variables = {}, numbers = {}, booleans = {}, properties = {}, types = { "italic" }, operators = {}, }, 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 = { 'm', 'j', '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 '' end, { expr = true }) map('n', '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' end, { expr = true }) -- Actions map('n', 'hs', gs.stage_hunk, { desc = "Stage hunk" }) map('n', 'hr', gs.reset_hunk, { desc = "Reset hunk" }) map('v', 'hs', function() gs.stage_hunk { vim.fn.line( '.' ), vim.fn.line('v') } end, { desc = "Stage hunk" }) map( 'v', 'hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end, { desc = "Reset hunk" } ) map('n', 'hS', gs.stage_buffer, { desc = "Stage buffer" }) map('n', 'hu', gs.undo_stage_hunk, { desc = "Undo stage hunk" }) map('n', 'hR', gs.reset_buffer, { desc = "Reset buffer" }) map('n', 'hp', gs.preview_hunk, { desc = "Preview hunk" }) map( 'n', 'hb', function() gs.blame_line { full = true } end, { desc = "Blame line" } ) map('n', 'hB', gs.blame, { desc = "Blame" }) map( 'n', 'tb', gs.toggle_current_line_blame, { desc = "Toggle current line blame" } ) map('n', 'hd', gs.diffthis, { desc = "Diff this" }) map('n', 'hD', function() gs.diffthis('~') end, { desc = "Diff this (ignore whitespace)" }) map('n', 'td', gs.toggle_deleted, { desc = "Toggle deleted" }) -- Text object map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = "Select hunk" }) end }) end, }, { "sustech-data/wildfire.nvim", event = "VeryLazy", dependencies = { "nvim-treesitter/nvim-treesitter" }, opts = { keymaps = { init_selection = "", node_incremental = "", node_decremental = "", } } }, { "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", [""] = "Stage", [""] = "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 = { { "", "MultipleCursorsAddDown", mode = { "n", "i" } }, { "", "MultipleCursorsAddDown" }, { "", "MultipleCursorsAddUp", mode = { "n", "i" } }, { "", "MultipleCursorsAddUp" }, { "", "MultipleCursorsMouseAddDelete", mode = { "n", "i" } }, { "a", "MultipleCursorsJumpNextMatch", mode = { "n", "x" } }, { "A", "MultipleCursorsAddMatchesV", mode = { "n", "x" } }, -- { "d", "MultipleCursorsAddJumpNextMatch", mode = { "n", "x" } }, -- { "D", "MultipleCursorsJumpNextMatch" }, }, }, { '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"}, "fl", ":FormatClang", { desc = "Format with clang"}) end }, { "chentoast/marks.nvim", opts = {}, }, { 'nvim-treesitter/nvim-treesitter-context', config = function() require 'treesitter-context'.setup { multiline_threshold = 1, } end }, { 'Weissle/persistent-breakpoints.nvim', config = function() require('persistent-breakpoints').setup { load_breakpoints_event = { "BufReadPost" } } 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" }, "d", ":Linediff ", { desc = "Linediff" }) end }, } return plugins