dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

plugins.lua (12096B)


      1 return {
      2   {
      3     'stevearc/dressing.nvim',
      4     opts = {},
      5   },
      6   {
      7     'neovim/nvim-lspconfig',
      8     dependencies = {
      9       -- Automatically install LSPs to stdpath for neovim
     10       {
     11         'williamboman/mason.nvim',
     12         opts = {},
     13       },
     14       {
     15         'williamboman/mason-lspconfig.nvim',
     16         config = function()
     17           require 'config.mason-lspconfig'
     18         end,
     19       },
     20 
     21       -- Useful status updates for LSP
     22       {
     23         'j-hui/fidget.nvim',
     24         opts = {},
     25       },
     26 
     27       -- Additional lua configuration, makes nvim stuff amazing
     28       {
     29         'folke/neodev.nvim',
     30         opts = {
     31           library = { plugins = { "nvim-dap-ui" }, types = true },
     32         },
     33       }
     34     },
     35   },
     36 
     37   {
     38     'jose-elias-alvarez/null-ls.nvim',
     39     config = function()
     40       local null_ls = require('null-ls')
     41       null_ls.setup { sources = {
     42         null_ls.builtins.diagnostics.shellcheck,
     43         null_ls.builtins.code_actions.shellcheck,
     44         null_ls.builtins.diagnostics.phpcs,
     45         -- null_ls.builtins.diagnostics.vacuum,
     46         null_ls.builtins.diagnostics.yamllint.with({
     47           extra_args = {
     48             "-d", [[{
     49               extends: default,
     50               rules: {
     51                 line-length: {max: 160},
     52                 document-start: disable,
     53                 comments: {
     54                   min-spaces-from-content: 1,
     55                 },
     56               }
     57               }]]
     58           }
     59         }),
     60         null_ls.builtins.diagnostics.checkmake,
     61         null_ls.builtins.diagnostics.flake8.with({
     62           extra_args = { "--max-line-length", "130" },
     63         }),
     64         -- null_ls.builtins.diagnostics.pylint,
     65         null_ls.builtins.diagnostics.ansiblelint,
     66       } }
     67     end,
     68   },
     69 
     70   { -- Autocompletion
     71     'hrsh7th/nvim-cmp',
     72     config = function()
     73       require 'config.nvim-cmp'
     74     end,
     75     dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'zjp-CN/nvim-cmp-lsp-rs' },
     76   },
     77 
     78   { -- Highlight, edit, and navigate code
     79     'nvim-treesitter/nvim-treesitter',
     80     build = function()
     81       pcall(require('nvim-treesitter.install').update { with_sync = true })
     82     end,
     83     config = function()
     84       require 'config.nvim-treesitter'
     85     end,
     86   },
     87 
     88   -- Additional text objects via treesitter
     89   'nvim-treesitter/nvim-treesitter-textobjects',
     90 
     91   {
     92     'lewis6991/gitsigns.nvim',
     93     opts = {
     94       signs = {
     95         add = { text = '+' },
     96         change = { text = '~' },
     97         delete = { text = '_' },
     98         topdelete = { text = '‾' },
     99         changedelete = { text = '~' },
    100       },
    101       on_attach = function()
    102         vim.keymap.set('n', ']c', function() require('gitsigns').next_hunk() end, { buffer = true })
    103         vim.keymap.set('n', '[c', function() require('gitsigns').prev_hunk() end, { buffer = true })
    104         vim.keymap.set('n', ']=', function() require('gitsigns').toggle_deleted() end, { buffer = true })
    105         vim.keymap.set('n', ']~', function() require('gitsigns').diffthis() end, { buffer = true })
    106         vim.keymap.set('n', ']-', function() require('gitsigns').preview_hunk() end, { buffer = true })
    107         vim.keymap.set('n', ']+', function() require('gitsigns').select_hunk() end, { buffer = true })
    108       end,
    109     },
    110   },
    111 
    112 
    113   { -- Add indentation guides even on blank lines
    114     'lukas-reineke/indent-blankline.nvim',
    115     main = 'ibl',
    116     opts = {
    117       indent = {
    118         char = '┊',
    119       },
    120     }
    121   },
    122 
    123   {
    124     'numToStr/Comment.nvim', -- "gc" to comment visual regions/lines
    125     opts = {}
    126   },
    127 
    128   -- Fuzzy Finder (files, lsp, etc)
    129   {
    130     'nvim-telescope/telescope.nvim',
    131     dependencies = { 'nvim-lua/plenary.nvim' },
    132     config = function()
    133       require 'config.telescope'
    134     end,
    135   },
    136 
    137   -- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
    138   {
    139     'nvim-telescope/telescope-fzf-native.nvim',
    140     build = 'make',
    141     cond = vim.fn.executable 'make' == 1
    142   },
    143 
    144   {
    145     "debugloop/telescope-undo.nvim",
    146     dependencies = { -- note how they're inverted to above example
    147       {
    148         "nvim-telescope/telescope.nvim",
    149         dependencies = { "nvim-lua/plenary.nvim" },
    150       },
    151     },
    152     keys = {
    153       { -- lazy style key map
    154         "<leader>U",
    155         "<cmd>Telescope undo<cr>",
    156         desc = "undo history",
    157       },
    158     },
    159     opts = {
    160       -- don't use `defaults = { }` here, do this in the main telescope spec
    161       extensions = {
    162         undo = {
    163           mappings = {
    164             i = {
    165               ["<cr>"] = function(bufnr)
    166                 return require("telescope-undo.actions").restore(bufnr)
    167               end,
    168               ["<C-y>"] = function(bufnr)
    169                 return require("telescope-undo.actions").yank_additions(bufnr)
    170               end,
    171             },
    172             n = {
    173               ["<cr>"] = function(bufnr)
    174                 return require("telescope-undo.actions").restore(bufnr)
    175               end,
    176               ["y"] = function(bufnr)
    177                 return require("telescope-undo.actions").yank_additions(bufnr)
    178               end,
    179             },
    180           },
    181         },
    182         -- no other extensions here, they can have their own spec too
    183       },
    184     },
    185     config = function(_, opts)
    186       -- Calling telescope's setup from multiple specs does not hurt, it will happily merge the
    187       -- configs for us. We won't use data, as everything is in it's own namespace (telescope
    188       -- defaults, as well as each extension).
    189       require("telescope").setup(opts)
    190       require("telescope").load_extension("undo")
    191     end,
    192   },
    193 
    194   {
    195     "folke/which-key.nvim",
    196     config = function()
    197       vim.o.timeout = true
    198       vim.o.timeoutlen = 300
    199       require("which-key").setup()
    200     end
    201   },
    202 
    203   -- DAP: debugging
    204   {
    205     'mfussenegger/nvim-dap',
    206     config = function()
    207       require 'config.nvim-dap'
    208     end
    209   },
    210   {
    211     'mfussenegger/nvim-dap-python',
    212     config = function()
    213       require('dap-python').setup(vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python")
    214     end
    215   },
    216   {
    217     "rcarriga/nvim-dap-ui",
    218     dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
    219     config = function()
    220       require 'config.nvim-dap-ui'
    221     end
    222   },
    223 
    224   {
    225     'theHamsta/nvim-dap-virtual-text',
    226     dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" },
    227     config = function()
    228       require("nvim-dap-virtual-text").setup()
    229     end
    230   },
    231 
    232   {
    233     'Eandrju/cellular-automaton.nvim',
    234     config = function()
    235       vim.keymap.set('n', 'q:', '<cmd>CellularAutomaton make_it_rain<CR>')
    236     end
    237   },
    238 
    239   {
    240     "folke/flash.nvim",
    241     event = "VeryLazy",
    242     ---@type Flash.Config
    243     opts = {
    244       search = {
    245         trigger = "\\",
    246       }
    247     },
    248     -- stylua: ignore
    249     keys = {
    250       { "<leader><leader>s", mode = { "n", "x", "o" }, function() require("flash").jump() end,              desc = "Flash" },
    251       { "<leader>S",         mode = { "n", "o", "x" }, function() require("flash").treesitter() end,        desc = "Flash Treesitter" },
    252       { "r",                 mode = "o",               function() require("flash").remote() end,            desc = "Remote Flash" },
    253       { "R",                 mode = { "o", "x" },      function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
    254       { "<c-s>",             mode = { "c" },           function() require("flash").toggle() end,            desc = "Toggle Flash Search" },
    255     },
    256   },
    257 
    258   {
    259     'mhartington/formatter.nvim',
    260     config = function()
    261       require("formatter").setup {
    262         filetype = { yaml = { require("formatter.filetypes.yaml").yamlfmt } }
    263       }
    264     end,
    265   },
    266 
    267   {
    268     "ray-x/lsp_signature.nvim",
    269     event = "VeryLazy",
    270     opts = {},
    271     config = function(_, opts) require 'lsp_signature'.setup(opts) end
    272   },
    273 
    274   -- LSP diagnostics at your corner.
    275   -- Messes up visual selection..
    276   -- { 'RaafatTurki/corn.nvim',
    277   --   opts = {},
    278   -- },
    279   {
    280     'dgagn/diagflow.nvim',
    281     opts = {},
    282     event = "VeryLazy",
    283   },
    284 
    285   {
    286     'stevearc/aerial.nvim',
    287     opts = {
    288       backends = { "lsp", "treesitter", "markdown", "man" },
    289       filter_kind = false,
    290     },
    291     -- Optional dependencies
    292     dependencies = {
    293       "nvim-treesitter/nvim-treesitter",
    294       "nvim-tree/nvim-web-devicons"
    295     },
    296     keys = {
    297       { "<leader>tt", "<cmd>AerialToggle!<cr>", desc = "Toggle tagbar" },
    298       { "<leader>to", "<cmd>AerialOpen<cr>",    desc = "Open and jump to tagbar" },
    299     },
    300   },
    301   {
    302     "nvim-treesitter/nvim-treesitter-context",
    303     dependencies = { "nvim-treesitter/nvim-treesitter" },
    304     config = function()
    305       require("treesitter-context").setup()
    306     end
    307   },
    308 
    309   -- diagnostics
    310   {
    311     "folke/trouble.nvim",
    312     branch = "dev", -- IMPORTANT!
    313     keys = {
    314       {
    315         "<leader>xx",
    316         "<cmd>Trouble diagnostics toggle<cr>",
    317         desc = "Diagnostics (Trouble)",
    318       },
    319       {
    320         "<leader>xb",
    321         "<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
    322         desc = "Buffer Diagnostics (Trouble)",
    323       },
    324       {
    325         "<leader>xs",
    326         "<cmd>Trouble symbols toggle focus=false<cr>",
    327         desc = "Symbols (Trouble)",
    328       },
    329       {
    330         "<leader>xd",
    331         "<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
    332         desc = "LSP Definitions / references / ... (Trouble)",
    333       },
    334       {
    335         "<leader>xl",
    336         "<cmd>Trouble loclist toggle<cr>",
    337         desc = "Location List (Trouble)",
    338       },
    339       {
    340         "<leader>xq",
    341         "<cmd>Trouble qflist toggle<cr>",
    342         desc = "Quickfix List (Trouble)",
    343       },
    344     },
    345     opts = {}, -- for default options, refer to the configuration section for custom setup.
    346   },
    347   {
    348     "echasnovski/mini.align",
    349     opts = {
    350       mappings = {
    351         start_with_preview = 'ga',
    352       },
    353     },
    354   },
    355   {
    356     "echasnovski/mini.ai",
    357     opts = {},
    358     event = "VeryLazy",
    359   },
    360   {
    361     "m00qek/baleia.nvim",
    362     version = "*",
    363     config = function()
    364       vim.g.baleia = require("baleia").setup({})
    365 
    366       -- Command to colorize the current buffer
    367       vim.api.nvim_create_user_command("BaleiaColorize", function()
    368         vim.g.baleia.once(vim.api.nvim_get_current_buf())
    369       end, { bang = true })
    370 
    371       -- Command to show logs
    372       vim.api.nvim_create_user_command("BaleiaLogs", vim.g.baleia.logger.show, { bang = true })
    373     end,
    374   },
    375   {
    376     "OXY2DEV/markview.nvim",
    377     lazy = false, -- Not needed, already handled by plugin
    378 
    379     dependencies = {
    380       "nvim-treesitter/nvim-treesitter",
    381       "nvim-tree/nvim-web-devicons"
    382     }
    383   },
    384   { -- Autoformat
    385     'stevearc/conform.nvim',
    386     event = { 'BufWritePre' },
    387     cmd = { 'ConformInfo' },
    388     keys = {
    389       {
    390         'gQ',
    391         function()
    392           require('conform').format { async = true, lsp_fallback = true }
    393         end,
    394         mode = '',
    395         desc = '[F]ormat buffer',
    396       },
    397     },
    398     opts = {
    399       notify_on_error = false,
    400       format_on_save = function(bufnr)
    401         -- Disable "format_on_save lsp_fallback" for languages that don't
    402         -- have a well standardized coding style. You can add additional
    403         -- languages here or re-enable it for the disabled ones.
    404         local disable_filetypes = { c = true, cpp = true }
    405         return {
    406           timeout_ms = 500,
    407           lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
    408         }
    409       end,
    410       formatters = {
    411         ruff = {
    412           prepend_args = { "--config", "~/Documents/cdmi/automation/meta-files/ruff.toml" },
    413         },
    414       },
    415       formatters_by_ft = {
    416         rust = { "rustfmt", lsp_format = "fallback" },
    417         python = { "ruff", lsp_format = "fallback" },
    418         ruby = { "rubyfmt", lsp_format = "fallback" },
    419         -- python = { "black", lsp_format = "fallback" },
    420         --   -- lua = { 'stylua' },
    421         --   -- Conform can also run multiple formatters sequentially
    422         --   -- python = { "isort", "black" },
    423         --   --
    424         --   -- You can use 'stop_after_first' to run the first available formatter from the list
    425         --   -- javascript = { "prettierd", "prettier", stop_after_first = true },
    426       },
    427     },
    428   },
    429 }