diff options
| author | Seth Flynn <[email protected]> | 2025-02-14 01:18:47 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-14 01:29:06 -0500 |
| commit | 3e208d20934bedd8cd7769f23f35cfae9d8e7d0d (patch) | |
| tree | 452399d770df6be2589be3c92771b1999dd1b93a /users/seth/mixins/vim.nix | |
| parent | c1bea770122a7cf2dea5113387265f59010d5a7f (diff) | |
seth: simplify module structure
Moving to mixins generally reduces the boilerplate in all
configurations, and less custom "stuff"
These are then enabled by the regular options in programs.nix for
example
Many of the other options (like desktops) also had little use in being
abstracted as there's no situation where I'd *not* want them to be
applied when said desktop is in use
Diffstat (limited to 'users/seth/mixins/vim.nix')
| -rw-r--r-- | users/seth/mixins/vim.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/users/seth/mixins/vim.nix b/users/seth/mixins/vim.nix new file mode 100644 index 0000000..e3269fc --- /dev/null +++ b/users/seth/mixins/vim.nix @@ -0,0 +1,42 @@ +{ + config, + pkgs, + ... +}: + +let + inherit (config.xdg) configHome dataHome stateHome; +in + +{ + programs.vim = { + packageConfigurable = pkgs.vim; + + settings = { + expandtab = false; + shiftwidth = 2; + tabstop = 2; + }; + + extraConfig = '' + " https://wiki.archlinux.org/title/XDG_Base_Directory + set runtimepath^=${configHome}/vim + set runtimepath+=${dataHome}/vim + set runtimepath+=${configHome}/vim/after + + set packpath^=${dataHome}/vim,${configHome}/vim + set packpath+=${configHome}/vim/after,${dataHome}/vim/after + set packpath^=${dataHome}/vim,${configHome}/vim + set packpath+=${configHome}/vim/after,${dataHome}/vim/after + + let g:netrw_home = "${dataHome}/vim" + call mkdir("${dataHome}/vim/spell", 'p') + + set backupdir=${stateHome}/vim/backup | call mkdir(&backupdir, 'p') + set directory=${stateHome}/vim/swap | call mkdir(&directory, 'p') + set undodir=${stateHome}/vim/undo | call mkdir(&undodir, 'p') + set viewdir=${stateHome}/vim/view | call mkdir(&viewdir, 'p') + set viminfofile=${stateHome}/vim/viminfo + ''; + }; +} |
