(neovim) move coding related components to extra loaded configuration

This commit is contained in:
Bartek Stalewski 2025-07-26 18:40:23 +02:00
parent 1d969481df
commit 86cf2fa9d4
No known key found for this signature in database
21 changed files with 185 additions and 156 deletions

View file

@ -1,2 +1,8 @@
if os.getenv("NVIM_MAIN_HOST") then
MainHost = true
else
MainHost = false
end
require("config") require("config")
require("core") require("core")

View file

@ -5,8 +5,9 @@ return {
Lua = { Lua = {
diagnostics = { diagnostics = {
globals = { globals = {
"vim", "MainHost",
"Snacks", "Snacks",
"vim",
}, },
}, },
}, },

View file

@ -54,14 +54,6 @@ map("n", "<leader>bl", function()
end, { desc = "buffer list", remap = true }) end, { desc = "buffer list", remap = true })
map("n", "<leader>bn", "<cmd>enew<CR>", { desc = "buffer create", remap = true }) map("n", "<leader>bn", "<cmd>enew<CR>", { desc = "buffer create", remap = true })
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
map({ "n", "v" }, "<leader>cf", function()
require("conform").format({
lsp_fallback = true,
async = false,
})
end, { desc = "format", remap = true })
map("n", "<leader>e", function() map("n", "<leader>e", function()
Snacks.explorer() Snacks.explorer()
end, { desc = "explorer", remap = true }) end, { desc = "explorer", remap = true })

View file

@ -16,7 +16,11 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
{ import = "plugins" }, { import = "plugins.common" },
{
import = "plugins.extra",
cond = MainHost,
},
}, },
defaults = { defaults = {
lazy = true, lazy = true,

View file

@ -0,0 +1,64 @@
local lualine_sections = {
lualine_a = { "mode" },
lualine_b = {
{ "branch" },
{
"diff",
symbols = {
added = "",
modified = "",
removed = "",
},
},
},
lualine_c = {
{ "filename", file_status = true, path = 1 },
},
lualine_x = {},
lualine_y = {
{ "searchcount" },
{ "progress", padding = { left = 1, right = 0 }, separator = " " },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {},
}
if MainHost then
table.insert(lualine_sections.lualine_x, {
"diagnostics",
symbols = {
error = "",
warn = "",
info = "",
hint = "",
},
})
table.insert(lualine_sections.lualine_x, {
"lsp_status",
symbols = {
spinner = { "", "", "", "", "", "", "", "", "", "" },
done = "",
separator = " ",
},
})
end
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
config = function()
require("lualine").setup({
options = {
theme = "powerline",
section_separators = "",
component_separators = "",
globalstatus = false,
disabled_filetypes = { statusline = { "snacks_dashboard" } },
},
sections = lualine_sections,
tabline = {
lualine_a = { "buffers" },
},
})
end,
}

View file

@ -1,4 +1,5 @@
return { return {
{
"echasnovski/mini.pairs", "echasnovski/mini.pairs",
event = "VeryLazy", event = "VeryLazy",
config = function() config = function()
@ -10,4 +11,21 @@ return {
markdown = true, markdown = true,
}) })
end, end,
},
{
"loctvl842/monokai-pro.nvim",
priority = 10000,
lazy = false,
dependencies = {
"echasnovski/mini.icons",
"echasnovski/mini.pairs",
},
config = function()
require("monokai-pro").setup({
filter = "classic",
})
vim.cmd.colorscheme("monokai-pro")
end,
}
} }

View file

@ -0,0 +1,37 @@
local treesitter_modules = {
"bash",
"markdown_inline",
"markdown",
}
if MainHost then
vim.list_extend(treesitter_modules, {
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"gotmpl",
"hcl",
"helm",
"json",
"lua",
"python",
"regex",
"terraform",
"yaml",
})
end
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "VeryLazy",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = treesitter_modules,
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View file

@ -0,0 +1,52 @@
local whichkey_spec = {
mode = { "n", "v" },
{ "<leader>b", group = "buffer" },
{ "<leader>f", group = "find" },
{ "<leader>h", group = "history" },
{ "<leader>u", group = "ui" },
}
if MainHost then
vim.list_extend(whichkey_spec, {
{ "<leader>c", group = "code" },
{ "<leader>cd", vim.diagnostic.open_float, { desc = "diagnostics", remap = true } },
{
"<leader>cf",
function()
require("conform").format({
lsp_fallback = true,
async = false,
})
end,
{ desc = "format", remap = true },
},
})
end
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
require("which-key").setup({
preset = "helix",
delay = 300,
icons = {
rules = false,
breadcrumb = "",
separator = "󱦰 ",
group = "󰹍 ",
},
plugins = {
spelling = {
enabled = false,
},
},
win = {
height = {
max = math.huge,
},
},
spec = whichkey_spec,
})
end,
}

View file

@ -64,7 +64,7 @@ return {
local markdownlint = require("lint").linters["markdownlint-cli2"] local markdownlint = require("lint").linters["markdownlint-cli2"]
markdownlint.args = { markdownlint.args = {
"--config", "--config",
vim.fn.stdpath("config") .. "/cfg_linters/global.markdownlint-cli2.yaml", vim.fn.stdpath("config") .. "/lua/config/global.markdownlint-cli2.yaml",
} }
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {

View file

@ -1,61 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
config = function()
require("lualine").setup({
options = {
theme = "powerline",
section_separators = "",
component_separators = "",
globalstatus = false,
disabled_filetypes = { statusline = { "snacks_dashboard" } },
},
sections = {
lualine_a = { "mode" },
lualine_b = {
{ "branch" },
{
"diff",
symbols = {
added = "",
modified = "",
removed = "",
},
},
{
"diagnostics",
symbols = {
error = "",
warn = "",
info = "",
hint = "",
},
},
},
lualine_c = {
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{ "filename", file_status = true, path = 1 },
},
lualine_x = {
{
"lsp_status",
symbols = {
spinner = { "", "", "", "", "", "", "", "", "", "" },
done = "",
separator = " ",
},
},
},
lualine_y = {
{ "searchcount" },
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {},
},
tabline = {
lualine_a = { "buffers" },
},
})
end,
}

View file

@ -1,14 +0,0 @@
return {
"loctvl842/monokai-pro.nvim",
priority = 10000,
lazy = false,
dependencies = {
"echasnovski/mini.icons",
},
config = function()
require("monokai-pro").setup({
filter = "classic",
})
vim.cmd.colorscheme("monokai-pro")
end,
}

View file

@ -1,32 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "VeryLazy",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"diff",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"gotmpl",
"hcl",
"helm",
"json",
"lua",
"markdown_inline",
"markdown",
"python",
"regex",
"terraform",
"vim",
"yaml",
},
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View file

@ -1,38 +0,0 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
require("which-key").setup({
preset = "helix",
delay = 300,
icons = {
rules = false,
breadcrumb = "",
separator = "󱦰 ",
group = "󰹍 ",
},
plugins = {
spelling = {
enabled = false,
},
},
win = {
height = {
max = math.huge,
},
},
spec = {
{
mode = { "n", "v" },
{ "[", group = "previous..." },
{ "]", group = "next..." },
{ "<leader>b", group = "buffer" },
{ "<leader>c", group = "code" },
{ "<leader>f", group = "find" },
{ "<leader>h", group = "history" },
{ "<leader>u", group = "ui" },
},
},
})
end,
}