Files
neovim-config/plugin/40_plugins.lua
T

117 lines
3.1 KiB
Lua

-- Colortheme ==================================================================
Config.now(function()
vim.pack.add({ "https://github.com/rebelot/kanagawa.nvim" })
require("kanagawa").setup({ compile = true })
vim.cmd("colo kanagawa")
end)
-- Mason ====================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/mason-org/mason.nvim" })
require("mason").setup()
end)
-- Treesitter ==================================================================
Config.now_if_args(function()
vim.pack.add({
'https://github.com/nvim-treesitter/nvim-treesitter',
'https://github.com/nvim-treesitter/nvim-treesitter-textobjects',
})
local languages = {
'lua',
'go',
'php',
'sql',
'javascript',
'typescript',
'tsx',
'dockerfile',
'yaml',
'markdown',
}
local isnt_installed = function(lang)
return #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.*', false) == 0
end
local to_install = vim.tbl_filter(isnt_installed, languages)
if #to_install > 0 then require('nvim-treesitter').install(to_install) end
Config.autocmd('FileType', languages, function(ev) vim.treesitter.start(ev.buf) end, 'Start tree-sitter')
end)
-- LSP =========================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/neovim/nvim-lspconfig" })
vim.lsp.enable({
"ansiblels",
"gopls",
"intelephense",
"lua_ls",
"tailwindcss",
"vtsls",
})
end)
-- Conform =====================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/stevearc/conform.nvim" })
require("conform").setup({
default_format_opts = { lsp_format = "fallback" },
format_on_save = {
lsp_format = "fallback",
timeout_ms = 500,
},
formatters_by_ft = {
go = { "gofumpt", "goimports" },
php = { "php_cs_fixer" },
},
})
end)
-- DAP =========================================================================
function Config.setup_dap()
if package.loaded["dap"] then
return
end
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" })
local dap = require("dap")
dap.adapters.php = {
type = "executable",
command = "node",
args = { vim.fn.stdpath("data") .. "/mason/packages/php-debug-adapter/extension/out/phpDebug.js" },
}
dap.adapters.go = {
type = "server",
host = "127.0.0.1",
port = "${port}",
}
end
-- Kulala ======================================================================
function Config.setup_kulala()
if package.loaded["kulala"] then
return
end
vim.pack.add({ "https://github.com/mistweaverco/kulala.nvim" })
require("kulala").setup({ default_env = "dev" })
end
-- Laravel =====================================================================
Config.now_if_args(function()
vim.pack.add({
"https://github.com/MunifTanjim/nui.nvim",
"https://github.com/nvim-lua/plenary.nvim",
"https://github.com/nvim-neotest/nvim-nio",
"https://github.com/adalessa/laravel.nvim",
})
require("laravel").setup({})
end)