- 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.
48 lines
993 B
Nix
48 lines
993 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (lib) mkEnableOption mkIf;
|
|
inherit (lib.metacfg) enabled;
|
|
|
|
cfg = config.metacfg.cli-apps.home-manager;
|
|
in
|
|
{
|
|
options.metacfg.cli-apps.home-manager = {
|
|
enable = mkEnableOption "home-manager";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.home-manager = enabled;
|
|
home.sessionVariables = {
|
|
EDITOR = "${pkgs.vim}/bin/vim";
|
|
BATDIFF_USE_DELTA = "true";
|
|
};
|
|
|
|
home.shellAliases = {
|
|
man = "${pkgs.bat-extras.batman}/bin/batman";
|
|
};
|
|
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
}
|