Skip to content

Commit

Permalink
Make .viminfo respect XDG Base Directory (#877)
Browse files Browse the repository at this point in the history
* Make .viminfo respect XDG Base Directory

Fixes GH-871

* Ensure to put vim directory in statehome

* Fix with avoiding missing xdg.stateHome
  • Loading branch information
kachick authored Oct 22, 2024
1 parent e3a178d commit cf75c40
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion home-manager/vim.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{ pkgs, homemade-pkgs, ... }:
{
pkgs,
config,
homemade-pkgs,
...
}:

{
# TODO: Prefer xdg.stateFile since home-manager release-24.11. See https://github.com/nix-community/home-manager/pull/5779
home.file."${config.xdg.stateHome}/vim/.keep".text = "Keep this directory because of home-manager and vim does not create the file if directory is missing";

# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/vim.nix
# https://nixos.wiki/wiki/Vim
programs.vim = {
Expand All @@ -20,6 +28,7 @@
extraConfig = ''
colorscheme iceberg
set termguicolors
set viminfofile=${config.xdg.stateHome}/vim/viminfo
'';
};
}

0 comments on commit cf75c40

Please sign in to comment.