feat(nvim): configure Neovim via nixvim with Nix-managed plugins
Add an nvim Module that configures Neovim declaratively through nixvim, wired as a flake input and consumed as its home-manager module. Options, globals, keymaps, and plugin settings are typed Nix; the colorscheme call and two autocmds live in modules/nvim/config.lua via extraConfigLua. Plugins come from nixpkgs (no plugin manager, no runtime cloning); git, ripgrep, and fd are provided from Nix; treesitter grammars are built by Nix so no runtime compiler is needed. Functionally matches the previous config (plugins, keymaps, options, the nord colorscheme, markdown conceal, the Neogit blame toggle), verified headless against the generated init.
This commit is contained in:
27
modules/nvim/config.lua
Normal file
27
modules/nvim/config.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Imperative configuration that has no typed nixvim option: the colorscheme
|
||||
-- call and two autocmds. Everything expressible as Nix lives in ./nvim.nix.
|
||||
|
||||
-- gbprod/nord.nvim, provided as an extra plugin from nixpkgs.
|
||||
require("nord").setup({
|
||||
transparent = true,
|
||||
})
|
||||
vim.cmd.colorscheme("nord")
|
||||
|
||||
-- Conceal markdown syntax in markdown buffers (previously an after/ftplugin).
|
||||
-- conceallevel is window-local, so it is set with opt_local when the filetype
|
||||
-- is applied to the buffer's window.
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.conceallevel = 2
|
||||
end,
|
||||
})
|
||||
|
||||
-- Turn line blame off again once the Neogit status buffer is closed.
|
||||
vim.api.nvim_create_autocmd("BufUnload", {
|
||||
callback = function(args)
|
||||
if vim.bo[args.buf].filetype == "NeogitStatus" then
|
||||
require("gitsigns").toggle_current_line_blame(false)
|
||||
end
|
||||
end,
|
||||
})
|
||||
Reference in New Issue
Block a user