nix-config/modules/neovim/editing.nix
2026-03-03 21:36:01 +01:00

82 lines
1.8 KiB
Nix

{ ... }:
{
flake.modules.homeManager.neovim-editing = { pkgs, ... }: {
programs.nixvim = {
plugins.sleuth.enable = true;
plugins.nvim-surround.enable = true;
plugins.flash.enable = true;
plugins.blink-pairs = {
enable = true;
};
plugins.treesitter = {
enable = true;
highlight.enable = true;
indent.enable = true;
folding.enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
angular
bash
css
html
javascript
jsdoc
json
lua
make
markdown
markdown_inline
go
gomod
gotmpl
python
styled
tsx
typescript
nix
regex
toml
vim
vimdoc
xml
yaml
];
};
plugins.substitute = {
enable = true;
luaConfig.post = /* lua */ ''
local sub = require("substitute")
vim.keymap.set("n", "s", sub.operator, { noremap = true })
vim.keymap.set("n", "ss", sub.line, { noremap = true })
vim.keymap.set("n", "S", sub.eol, { noremap = true })
vim.keymap.set("x", "s", sub.visual, { noremap = true })
'';
};
extraPlugins = [
pkgs.vimPlugins.vim-cool
];
autoCmd = [
{
callback.__raw = "function() vim.highlight.on_yank() end";
event = [
"TextYankPost"
];
}
{
event = [ "FileType" ];
pattern = "qf";
callback.__raw = /* lua */ ''
function()
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
end
'';
}
];
};
};
}