update nvim

This commit is contained in:
2023-02-03 16:08:09 +01:00
parent c5d8b5ef2b
commit 057b357f05
19 changed files with 218 additions and 16 deletions

4
plugins/crates-nvim.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"Saecki/crates.nvim",
config = function() require("crates").setup() end,
}

View File

@@ -1,7 +1,7 @@
return {
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = { "sumneko_lua", "rust_analyzer", "gopls", "yamlls", "tsserver", "terraformls" },
automatic_installation = true,
ensure_installed = { "sumneko_lua", "gopls", "yamlls", "tsserver", "terraformls", "jsonls", "jdtls" },
automatic_installation = { exclude = { "rust_analyzer" } },
},
}

View File

@@ -1,4 +1,35 @@
return { -- overrides `require("mason-null-ls").setup(...)`
"jay-babu/mason-null-ls.nvim",
opts = { ensure_installed = { "prettier", "stylua" } },
config = function(plugin, opts)
plugin.default_config(opts) -- use the default configuration function
local null_ls = require "null-ls"
require("mason-null-ls").setup_handlers { -- setup custom handlers
prettier = function()
require("null-ls").register(null_ls.builtins.formatting.prettier.with {
condition = function(utils)
return utils.root_has_file "package.json"
or utils.root_has_file ".prettierrc"
or utils.root_has_file ".prettierrc.json"
or utils.root_has_file ".prettierrc.js"
end,
})
end,
-- For prettierd:
-- prettierd = function()
-- require("null-ls").register(require("null-ls").builtins.formatting.prettierd.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".prettierrc") or utils.root_has_file(".prettierrc.json") or utils.root_has_file(".prettierrc.js")
-- end
-- }))
-- end,
-- For eslint_d:
-- eslint_d = function()
-- require("null-ls").register(require("null-ls").builtins.diagnostics.eslint_d.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".eslintrc.json") or utils.root_has_file(".eslintrc.js")
-- end
-- }))
-- end,
}
end,
}

View File

@@ -0,0 +1,31 @@
return {
"jay-babu/mason-nvim-dap.nvim",
config = function(self, opts)
self.default_config(opts) -- run default AstroNvim mason-nvim-dap config function
-- do more configuration as needed
local mason_nvim_dap = require "mason-nvim-dap"
mason_nvim_dap.setup_handlers {
python = function(source_name)
local dap = require "dap"
dap.adapters.python = {
type = "executable",
command = "/usr/bin/python3",
args = {
"-m",
"debugpy.adapter",
},
}
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}", -- This configuration will launch the current file if used.
},
}
end,
}
end,
}

24
plugins/nvim-cmp.lua Normal file
View File

@@ -0,0 +1,24 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji", -- add cmp source as dependency of cmp
},
-- override the options table that is used in the `require("cmp").setup()` call
opts = function(_, opts)
-- opts parameter is the default options table
-- the function is lazy loaded so cmp is able to be required
local cmp = require "cmp"
-- modify the sources part of the options table
opts.sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
{ name = "emoji", priority = 700 }, -- add new source
{ name = "crates", priority = 1000 },
}
-- return the new table to be used
return opts
end,
}

3
plugins/nvim-jdtls.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"mfussenegger/nvim-jdtls", -- load jdtls on module
}

4
plugins/nvim-metals.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"scalameta/nvim-metals",
dependencies = { "nvim-lua/plenary.nvim" },
}

View File

@@ -1,5 +1,6 @@
return {
after = "telescope.nvim",
"pwntester/octo.nvim",
event = "UIEnter",
config = function() require("octo").setup() end,
}

View File

@@ -1,4 +1,5 @@
return {
"kjuulh/ranger.nvim",
event = "UIEnter",
config = function() require("ranger").setup {} end,
}

3
plugins/rust-tools.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"simrat39/rust-tools.nvim",
}

13
plugins/which-key.lua Normal file
View File

@@ -0,0 +1,13 @@
return {
"folke/which-key.nvim",
config = function(plugin, opts)
plugin.default_config(opts)
local wk = require "which-key"
wk.register({
b = { name = "Buffer" },
}, {
mode = "n",
prefix = "<leader>",
})
end,
}