2024-03-12 17:20:24 +01:00
|
|
|
return {
|
2024-05-29 19:46:03 +02:00
|
|
|
{
|
|
|
|
"direnv/direnv.vim",
|
|
|
|
lazy = false,
|
|
|
|
priority = 900,
|
2024-06-01 23:58:47 +02:00
|
|
|
config = function()
|
|
|
|
vim.g.direnv_silent_load = 1
|
|
|
|
end,
|
2024-05-29 19:46:03 +02:00
|
|
|
},
|
|
|
|
|
2024-03-12 17:20:24 +01:00
|
|
|
{
|
|
|
|
"nvimtools/none-ls.nvim",
|
|
|
|
opts = function(_, opts)
|
|
|
|
local nls = require("null-ls")
|
|
|
|
opts.root_dir = opts.root_dir
|
|
|
|
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
|
|
|
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
2024-03-18 17:47:39 +01:00
|
|
|
nls.builtins.formatting.mdformat,
|
2024-03-12 17:20:24 +01:00
|
|
|
nls.builtins.formatting.stylua,
|
|
|
|
nls.builtins.formatting.shfmt,
|
|
|
|
nls.builtins.formatting.buf,
|
2024-05-10 22:33:44 +02:00
|
|
|
nls.builtins.formatting.buildifier,
|
2024-05-12 11:25:35 +02:00
|
|
|
nls.builtins.diagnostics.buildifier,
|
2024-03-12 17:20:24 +01:00
|
|
|
nls.builtins.diagnostics.buf.with({
|
|
|
|
args = { "lint", "--disable-symlinks", "--path", "$FILENAME" },
|
|
|
|
cwd = function()
|
|
|
|
local file_dir = vim.fn.expand("%:p:h") .. ";"
|
|
|
|
local buf_yaml = vim.fn.findfile("buf.yaml", file_dir)
|
|
|
|
if buf_yaml then
|
|
|
|
return vim.fn.fnamemodify(buf_yaml, ":h")
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2024-03-27 23:19:10 +01:00
|
|
|
{
|
|
|
|
"nvim-neo-tree/neo-tree.nvim",
|
|
|
|
opts = {
|
|
|
|
window = {
|
|
|
|
width = 30,
|
|
|
|
position = "right",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2024-03-12 17:20:24 +01:00
|
|
|
{
|
|
|
|
"simrat39/rust-tools.nvim",
|
|
|
|
enabled = false,
|
|
|
|
},
|
2024-05-30 19:54:42 +02:00
|
|
|
|
2024-03-12 17:20:24 +01:00
|
|
|
{
|
|
|
|
"mrcjkb/rustaceanvim",
|
|
|
|
version = "^4", -- Recommended
|
|
|
|
ft = { "rust" },
|
|
|
|
opts = {
|
|
|
|
server = {
|
|
|
|
on_attach = function(_, bufnr)
|
|
|
|
vim.keymap.set("n", "<leader>cR", function()
|
|
|
|
vim.cmd.RustLsp("codeAction")
|
|
|
|
end, { desc = "Code Action", buffer = bufnr })
|
|
|
|
vim.keymap.set("n", "<leader>dr", function()
|
|
|
|
vim.cmd.RustLsp("debuggables")
|
|
|
|
end, { desc = "Rust debuggables", buffer = bufnr })
|
|
|
|
vim.keymap.set("n", "<leader>cD", function()
|
|
|
|
vim.cmd.RustLsp("externalDocs")
|
|
|
|
end, { desc = "Rust external documentation", buffer = bufnr })
|
|
|
|
end,
|
|
|
|
},
|
2024-05-09 11:16:52 +02:00
|
|
|
|
|
|
|
settings = {
|
|
|
|
-- rust-analyzer language server configuration
|
|
|
|
["rust-analyzer"] = {
|
|
|
|
cargo = {
|
|
|
|
allFeatures = true,
|
|
|
|
loadOutDirsFromCheck = true,
|
|
|
|
runBuildScripts = true,
|
|
|
|
targetDir = true,
|
|
|
|
},
|
|
|
|
-- Add clippy lints for Rust.
|
|
|
|
checkOnSave = {
|
|
|
|
allFeatures = true,
|
|
|
|
command = "clippy",
|
|
|
|
extraArgs = { "--no-deps" },
|
|
|
|
},
|
|
|
|
procMacro = {
|
|
|
|
enable = true,
|
|
|
|
ignored = {
|
|
|
|
["async-trait"] = { "async_trait" },
|
|
|
|
["napi-derive"] = { "napi" },
|
|
|
|
["async-recursion"] = { "async_recursion" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-03-12 17:20:24 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|