139 lines
3.7 KiB
Lua
139 lines
3.7 KiB
Lua
-- Plugins that are related to coding. Such as lsp
|
|
-- or language specific.
|
|
return {
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
event = "VeryLazy",
|
|
config = function()
|
|
require("plugins.configs.lspconfig")
|
|
end,
|
|
},
|
|
{
|
|
"williamboman/mason.nvim",
|
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
|
|
opts = function()
|
|
return require("plugins.configs.mason")
|
|
end,
|
|
config = function(_, opts)
|
|
require("mason").setup(opts)
|
|
|
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
|
if opts.ensure_installed then
|
|
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
|
|
end
|
|
end, {})
|
|
|
|
vim.g.mason_binaries_list = opts.ensure_installed
|
|
end,
|
|
},
|
|
{
|
|
"numToStr/Comment.nvim",
|
|
keys = {
|
|
{ "gcc", mode = "n", desc = "Comment toggle current line" },
|
|
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
|
|
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
|
|
{ "gbc", mode = "n", desc = "Comment toggle current block" },
|
|
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
|
|
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
|
|
},
|
|
init = function()
|
|
local wk = require("which-key")
|
|
wk.register({
|
|
["/"] = {
|
|
function()
|
|
require("Comment.api").toggle.linewise.current()
|
|
end,
|
|
"Toggle comment",
|
|
},
|
|
}, {
|
|
prefix = "<leader>",
|
|
mode = "n",
|
|
})
|
|
wk.register({
|
|
["/"] = {
|
|
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
|
|
"Toggle comment",
|
|
},
|
|
}, {
|
|
prefix = "<leader>",
|
|
mode = "v",
|
|
})
|
|
end,
|
|
config = function(_, opts)
|
|
require("Comment").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
event = { "BufReadPost", "BufNewFile" },
|
|
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
|
build = ":TSUpdate",
|
|
dependencies = {
|
|
"apple/pkl-neovim",
|
|
},
|
|
opts = function()
|
|
return require("plugins.configs.treesitter")
|
|
end,
|
|
config = function(_, opts)
|
|
require("nvim-treesitter.configs").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"hrsh7th/nvim-cmp",
|
|
event = "InsertEnter",
|
|
dependencies = {
|
|
{
|
|
-- snippet plugin
|
|
"L3MON4D3/LuaSnip",
|
|
dependencies = "rafamadriz/friendly-snippets",
|
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
|
config = function(_, opts)
|
|
require("plugins.configs.others").luasnip(opts)
|
|
end,
|
|
},
|
|
|
|
-- autopairing of (){}[] etc
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
opts = {
|
|
fast_wrap = {},
|
|
disable_filetype = { "TelescopePrompt", "vim" },
|
|
},
|
|
config = function(_, opts)
|
|
require("nvim-autopairs").setup(opts)
|
|
|
|
-- setup cmp for autopairs
|
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
|
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
|
end,
|
|
},
|
|
"saadparwaiz1/cmp_luasnip",
|
|
"hrsh7th/cmp-nvim-lua",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
"hrsh7th/cmp-buffer",
|
|
"hrsh7th/cmp-path",
|
|
},
|
|
opts = function()
|
|
return require("plugins.configs.cmp")
|
|
end,
|
|
config = function(_, opts)
|
|
require("cmp").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"nvimtools/none-ls.nvim",
|
|
opts = function()
|
|
return require("plugins.configs.null-ls")
|
|
end,
|
|
},
|
|
{
|
|
"saecki/crates.nvim",
|
|
ft = { "rust", "toml" },
|
|
config = function(_, opts)
|
|
local crates = require("crates")
|
|
crates.setup(opts)
|
|
crates.show()
|
|
end,
|
|
},
|
|
}
|