nvim/lua/plugins.lua
Mira Kristipati ba838cfab2 grapple
2024-05-21 18:23:14 -04:00

294 lines
6.3 KiB
Lua

local overrides = require "configs.overrides"
local mappings = require "mappings"
---@type NvPluginSpec[]
return {
---------------------
-- General Plugins --
---------------------
-- LSP Stuff
{
"williamboman/mason.nvim",
-- opts = overrides.mason
opts = {
ensure_installed = {
-- rust stuff
"rust-analyzer",
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
-- "deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
-- python stuff
"pyright",
"mypy",
"autoflake",
"debugpy",
-- "ruff",
"shellharden",
"gopls",
},
},
},
{
"cbochs/grapple.nvim",
dependencies = {
{ "nvim-tree/nvim-web-devicons", lazy = true },
},
lazy = false,
},
{
"nvimdev/lspsaga.nvim",
config = function()
require("lspsaga").setup {}
end,
dependencies = {
"nvim-treesitter/nvim-treesitter", -- optional
"nvim-tree/nvim-web-devicons", -- optional
},
},
{ "ThePrimeagen/refactoring.nvim" },
{
"nvimtools/none-ls.nvim",
lazy = false,
dependencies = "nvimtools/none-ls-extras.nvim",
opts = function()
return require "configs.null-ls"
end,
},
{
"neovim/nvim-lspconfig",
config = function()
require "nvchad.configs.lspconfig"
require "configs.lspconfig"
end, -- Override to setup mason-lspconfig
dependencies = {
"nvimdev/lspsaga.nvim",
},
lazy = false,
},
-- Debugger
{
"mfussenegger/nvim-dap",
config = function(_, opts)
mappings.Dap()
end,
},
{
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
config = function()
local dap = require "dap"
local dapui = require "dapui"
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
},
-- Delimiters
{ "Raimondi/delimitMate", lazy = false },
-- lazygit
{
"kdheepak/lazygit.nvim",
config = function()
mappings.LazyGit()
end,
lazy = false,
},
-- fzf
{ "junegunn/fzf.vim", lazy = false },
{
"nvim-telescope/telescope.nvim",
config = function()
require("telescope").setup()
require("telescope").load_extension "grapple"
end,
dependencies = { "nvim-lua/plenary.nvim", "junegunn/fzf.vim" },
},
-- Syntax Highlighting
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
dependencies = {
-- NOTE: additional parser
{ "nushell/tree-sitter-nu" },
},
},
-- File manager
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
-- Syntax Highlighting
{
"nvim-treesitter/nvim-treesitter",
-- TODO:
opts = overrides.treesitter,
},
-- File manager
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
{ "zbirenbaum/copilot.lua", event = "InsertEnter", lazy = false },
-- Nyoom around files
{
"smoka7/hop.nvim",
lazy = false,
config = function()
local hop = require "hop"
hop.setup()
print(mappings.Hop())
end,
},
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
config = function()
require("ufo").setup {
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
}
mappings.Ufo()
end,
lazy = false,
},
------------
-- Python --
------------
{
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
config = function(_, opts)
local path = nil
local is_windows = vim.fn.has "win64" == 1 or vim.fn.has "win32" == 1 or vim.fn.has "win16" == 1
if is_windows then
local cmd = io.popen("where.exe python", "r")
path = cmd:read "*line"
cmd:close()
else
local cmd = io.popen("which python", "r")
path = cmd:read "*line"
cmd:close()
end
require("dap-python").setup(path)
mappings.Dap_python()
end,
},
----------
-- Rust --
----------
{
"rust-lang/rust.vim",
ft = "rust",
init = function()
vim.g.rustfmt_autosave = 1
end,
},
{
"saecki/crates.nvim",
ft = { "rust", "toml" },
config = function(_, opts)
local crates = require "crates"
crates.setup(opts)
crates.show()
end,
},
-----------
-- swkhd --
-----------
{ "waycrate/swhkd-vim", ft = { "swhkdrc", "swhkd" } },
--------------
-- Obsidian --
--------------
-- {
-- "epwalsh/obsidian.nvim",
-- ft = "markdown",
-- lazy = false,
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "nvim-telescope/telescope.nvim",
-- "nvim-treesitter/nvim-treesitter",
-- },
-- opts = {
-- -- workspaces = {}
-- config = function(_, opts)
-- end,
-- },
-- },
--------------
-- Markdown --
--------------
{
"nfrid/markdown-togglecheck",
dependencies = { "nfrid/treesitter-utils" },
ft = { "markdown" },
config = function(_, opts)
-- require("markdown-togglecheck").setup()
mappings.Markdown()
end,
},
------------
-- Golang --
------------
{
"leoluz/nvim-dap-go",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
ft = "go",
config = function(_, opts)
require("dap-go").setup()
mappings.Dap_go()
end,
},
-- All NvChad plugins are lazy-loaded by default
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
-- {
-- "mg979/vim-visual-multi",
-- lazy = false,
-- }
}