commit b77e17d4aa08daf35a7af16e3d0150df7eaf0fa3
parent 1e5bd5102722b0d9863ee4b611248ca520e19193
Author: Peter <peter@minskio.co.uk>
Date: Mon, 14 Sep 2026 13:13:54 +0100
Add Uppercase and Lowercase nvim commands
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/home/neovim.nix b/home/neovim.nix
@@ -1,4 +1,6 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+
+{
programs.neovim = {
enable = true;
withPython3 = false;
@@ -36,5 +38,13 @@
autocmd BufWritepre * %s/\n\+\%$//e
lua << EOF
'';
+ initLua = ''
+ vim.api.nvim_create_user_command("Uppercase", function()
+ vim.cmd("'<,'>s/.*/\\U&/")
+ end, { range = true })
+ vim.api.nvim_create_user_command("Lowercase", function()
+ vim.cmd("'<,'>s/.*/\\L&/")
+ end, { range = true })
+ '';
};
}