neovim refactor for the ages
This commit is contained in:
parent
f374536df1
commit
18e2ae58fb
9 changed files with 151 additions and 93 deletions
|
@ -17,6 +17,7 @@ require("lazy").setup({
|
|||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lsp.none-ls" },
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.language" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
|
|
|
@ -24,60 +24,24 @@ return {
|
|||
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"ruff",
|
||||
"ruff-lsp",
|
||||
"lua-language-server",
|
||||
"nimlsp",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function()
|
||||
local nls = require("null-ls")
|
||||
return {
|
||||
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
|
||||
sources = {
|
||||
nls.builtins.formatting.stylua,
|
||||
nls.builtins.formatting.shfmt,
|
||||
nls.builtins.diagnostics.ruff,
|
||||
nls.builtins.diagnostics.shellcheck,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"dockerfile",
|
||||
"html",
|
||||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"latex",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nix",
|
||||
"python",
|
||||
"regex",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, {
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"html",
|
||||
"toml",
|
||||
"json",
|
||||
"yaml",
|
||||
"yuck",
|
||||
"zig",
|
||||
},
|
||||
},
|
||||
|
||||
"go",
|
||||
"regex",
|
||||
|
||||
"javascript",
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ local plugins = {}
|
|||
|
||||
local single_host_plugins = {
|
||||
othalan = {
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter/pull/5437
|
||||
-- { "aMOPel/nvim-treesitter-nim" }
|
||||
{ "kaarmu/typst.vim" },
|
||||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
|
|
26
home/private_dot_config/nvim/lua/plugins/language/lua.lua
Normal file
26
home/private_dot_config/nvim/lua/plugins/language/lua.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, { "lua" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.formatting.stylua,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, {
|
||||
"stylua",
|
||||
"lua-language-server",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
25
home/private_dot_config/nvim/lua/plugins/language/nim.lua
Normal file
25
home/private_dot_config/nvim/lua/plugins/language/nim.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "nim", "nim_format_string" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, {
|
||||
"nimlsp",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
table.insert(opts.sources or {}, nls.builtins.formatting.nimpretty)
|
||||
end,
|
||||
},
|
||||
}
|
60
home/private_dot_config/nvim/lua/plugins/language/python.lua
Normal file
60
home/private_dot_config/nvim/lua/plugins/language/python.lua
Normal file
|
@ -0,0 +1,60 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "python", "toml" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "ruff", "ruff-lsp" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
table.insert(opts.sources or {}, nls.builtins.formatting.ruff)
|
||||
end,
|
||||
},
|
||||
-- modified from https://www.lazyvim.org/extras/lang/python#nvim-lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
ruff_lsp = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
ruff_lsp = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||
if client.name == "ruff_lsp" then
|
||||
-- Disable hover in favor of Pyright
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
25
home/private_dot_config/nvim/lua/plugins/language/shell.lua
Normal file
25
home/private_dot_config/nvim/lua/plugins/language/shell.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, { "bash" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.diagnostics.shellcheck,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = vim.list_extend(opts.ensure_installed or {}, {
|
||||
"shellcheck",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
-- local function add_words()
|
||||
-- local path = vim.fn.stdpath("config") .. "/spell/en.utf-8.add"
|
||||
-- local words = {}
|
||||
-- for word in io.open(path, "r"):lines() do
|
||||
-- table.insert(words, word)
|
||||
-- end
|
||||
-- return words
|
||||
-- end
|
||||
--
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
-- ltex = {
|
||||
-- settings = {
|
||||
-- ltex = {
|
||||
-- dictionary = { ["en-US"] = add_words() },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
pylsp = {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
-- I'll do the formatting myself
|
||||
autopep8 = { enabled = false },
|
||||
mccabe = { enabled = false },
|
||||
pycodestyle = { enabled = false },
|
||||
pyflakes = { enabled = false },
|
||||
yapf = { enabled = false },
|
||||
ruff = {
|
||||
enabled = true,
|
||||
extendSelect = { "I" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue