Restructure
This commit is contained in:
84
config/nvim/lua/core/plugins.lua
Normal file
84
config/nvim/lua/core/plugins.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
-- core/plugins.lua - optional plugin layer (lazy.nvim).
|
||||
-- Kept minimal & ops-focused. If the machine is offline at first launch this
|
||||
-- module raises an error that init.lua catches; the core config still works.
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
-- only attempt clone if git exists; error out cleanly otherwise
|
||||
if vim.fn.executable("git") == 0 then
|
||||
error("git not available; skipping plugins")
|
||||
end
|
||||
local out = vim.fn.system({
|
||||
"git", "clone", "--filter=blob:none", "--branch=stable",
|
||||
"https://github.com/folke/lazy.nvim.git", lazypath,
|
||||
})
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error("lazy.nvim clone failed: " .. out)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
-- colorscheme
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("tokyonight").setup({ style = "night" })
|
||||
pcall(vim.cmd.colorscheme, "tokyonight")
|
||||
end,
|
||||
},
|
||||
|
||||
-- statusline (light, no icons required so it works in plain TTYs)
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = { theme = "auto", icons_enabled = false, globalstatus = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- fuzzy finder: files / grep / buffers
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
{ "<leader>ff", "<cmd>Telescope find_files<CR>", desc = "find files" },
|
||||
{ "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "grep (ripgrep)" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<CR>", desc = "buffers" },
|
||||
{ "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "help" },
|
||||
},
|
||||
},
|
||||
|
||||
-- treesitter: better syntax highlighting for the configs we actually touch
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua", "bash", "yaml", "json", "toml", "dockerfile",
|
||||
"nix", "python", "markdown", "diff", "git_config",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- git signs in the gutter
|
||||
{ "lewis6991/gitsigns.nvim", opts = {} },
|
||||
|
||||
-- show pending keybinds
|
||||
{ "folke/which-key.nvim", event = "VeryLazy", opts = {} },
|
||||
|
||||
-- quick comment toggling: gcc / gc in visual
|
||||
{ "numToStr/Comment.nvim", opts = {} },
|
||||
}, {
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = { enabled = false }, -- don't phone home on managed hosts
|
||||
change_detection = { notify = false },
|
||||
ui = { border = "rounded" },
|
||||
})
|
||||
Reference in New Issue
Block a user