vimPlugins: vim-sensible patch vimrc detection

The vimrc detection won't work if you are using the vim_configurable package
(which the nixos and home-manager module both do)
because vim-sensible only checks for files in the users home matches `~/...`
but in our case it gets called from a wrapper script which looks something like:
`vim -u /nix/store/.../vimrc`.
This commit is contained in:
Janik H
2023-09-16 21:00:55 +02:00
parent f0b0a2fa2b
commit 9a98cd21e8
2 changed files with 29 additions and 0 deletions
@@ -1467,6 +1467,10 @@ self: super: {
dependencies = with self; [ denops-vim ];
};
vim-sensible = super.vim-sensible.overrideAttrs {
patches = [ ./patches/vim-sensible/fix-nix-store-path-regex.patch ];
};
vim-snipmate = super.vim-snipmate.overrideAttrs {
dependencies = with self; [ vim-addon-mw-utils tlib_vim ];
};
@@ -0,0 +1,25 @@
From 07c799a1b170c0e28b385474b511c1034cfcb263 Mon Sep 17 00:00:00 2001
From: Janik H <janik@aq0.de>
Date: Sat, 16 Sep 2023 19:45:32 +0200
Subject: [PATCH] fix nix store path regex
---
plugin/sensible.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/sensible.vim b/plugin/sensible.vim
index 0fc26e0..b3ee6e9 100644
--- a/plugin/sensible.vim
+++ b/plugin/sensible.vim
@@ -26,7 +26,7 @@ function! s:MaySet(option) abort
silent verbose execute 'setglobal all' a:option . '?'
redir END
endif
- return out !~# " \\(\\~[\\/][^\n]*\\|Lua\\)$"
+ return out !~# "/nix/store/.*" && out !~# " \\(\\~[\\/][^\n]*\\|Lua\\)$"
endfunction
if s:MaySet('backspace')
--
2.41.0