Refactor nvim config into logical modules

This commit is contained in:
Daniel McKnight 2025-06-01 20:22:28 -07:00
parent d2467209b7
commit ec5a00e99d
9 changed files with 134 additions and 130 deletions

View file

@ -12,6 +12,7 @@ vim.cmd("set shiftwidth=2")
-- Configure Editor Settings
vim.cmd("set number")
vim.cmd("set spl=en_us spell")
vim.opt.guifont = "JetBrainsMonoNerdFontMono:14"
-- Custom Key Binds
vim.g.mapleader = " "

View file

@ -1,7 +0,0 @@
return {
"romgrk/barbar.nvim",
tag = "v1.9.0",
--init = function()
-- vim.g.barbar_auto_setup = false
--end,
}

View file

@ -0,0 +1,31 @@
return {
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
--`theme=codedark,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
end,
},
{
"romgrk/barbar.nvim",
tag = "v1.9.0",
--init = function()
-- vim.g.barbar_auto_setup = false
--end,
},
}

View file

@ -0,0 +1,102 @@
return {
{
"mason-org/mason.nvim",
tag = "v1.11.0",
config = function()
require("mason").setup({})
end,
},
{
"mason-org/mason-lspconfig.nvim",
tag = "v1.32.0",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"bashls",
"dockerls",
--"gh-actions-language-server",
"helm_ls",
"jsonls",
"marksman",
"nginx_language_server",
"ruff",
"yamlls",
},
})
end,
},
{
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.mdformat,
},
})
vim.keymap.set("n", "<leader>af", vim.lsp.buf.format, { desc = "Auto-Format File" })
end,
},
{
"neovim/nvim-lspconfig",
tag = "v1.8.0",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
lspconfig.bashls.setup({})
lspconfig.dockerls.setup({})
lspconfig.helm_ls.setup({})
lspconfig.jsonls.setup({})
lspconfig.nginx_language_server.setup({})
lspconfig.marksman.setup({})
lspconfig.ruff.setup({})
lspconfig.yamlls.setup({})
vim.keymap.set("n", "<leader>d", vim.lsp.buf.hover, { desc = "Show Docstring" })
vim.keymap.set("n", "<leader>gt", vim.lsp.buf.definition, { desc = "Go To Definition" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" })
end,
},
{
"nvim-treesitter/nvim-treesitter",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = {
"lua",
"vim",
"vimdoc",
"query",
"markdown",
"markdown_inline",
"json",
"jsonc",
"python",
"yaml",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (or "all")
ignore_install = { "javascript" },
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
})
end,
},
}

View file

@ -1,21 +0,0 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
--`theme=codedark,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
})
end
}

View file

@ -1,29 +0,0 @@
return {
{
"mason-org/mason.nvim",
tag = "v1.11.0",
config = function()
require("mason").setup({})
end,
},
{
"mason-org/mason-lspconfig.nvim",
tag = "v1.32.0",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"bashls",
"dockerls",
--"gh-actions-language-server",
"helm_ls",
"jsonls",
"marksman",
"nginx_language_server",
"ruff",
"yamlls",
},
})
end,
},
}

View file

@ -1,13 +0,0 @@
return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.mdformat,
},
})
vim.keymap.set("n", "<leader>af", vim.lsp.buf.format, {desc="Auto-Format File"})
end,
}

View file

@ -1,19 +0,0 @@
return {
"neovim/nvim-lspconfig",
tag = "v1.8.0",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
lspconfig.bashls.setup({})
lspconfig.dockerls.setup({})
lspconfig.helm_ls.setup({})
lspconfig.jsonls.setup({})
lspconfig.nginx_language_server.setup({})
lspconfig.marksman.setup({})
lspconfig.ruff.setup({})
lspconfig.yamlls.setup({})
vim.keymap.set("n", "<leader>d", vim.lsp.buf.hover, { desc = "Show Docstring" })
vim.keymap.set("n", "<leader>gt", vim.lsp.buf.definition, { desc = "Go To Definition" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" })
end,
}

View file

@ -1,41 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = {
"lua",
"vim",
"vimdoc",
"query",
"markdown",
"markdown_inline",
"json",
"jsonc",
"python",
"yaml",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (or "all")
ignore_install = { "javascript" },
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
})
end,
}