feat(nix): enable Vim with custom configuration

- Enabled Vim in `default.nix` and added custom configuration under `programs.vim`.
- Includes settings for indentation, syntax highlighting, secure mode, and automatic cursor position restoration.
- Improves default usability and aligns with user preferences for Vim.
This commit is contained in:
Harald Hoyer 2026-01-21 12:54:02 +01:00
parent fce17e443e
commit 2f54f6e966

View file

@ -27,6 +27,22 @@ in
man = "${pkgs.bat-extras.batman}/bin/batman";
};
home.packages = with pkgs; [ vim ];
programs.vim = {
enable = true;
extraConfig = ''
filetype indent off
set ts=4 sw=4 et sts=4
let spec_chglog_format = "%a %b %d %Y Harald Hoyer <harald@hoyer.xyz>"
set exrc
set secure
syntax on
" Restore cursor to last edit position
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
'';
};
};
}