From 9a98cd21e8c8c920830acfa55c5acdc82ea1b7a6 Mon Sep 17 00:00:00 2001 From: Janik H Date: Sat, 16 Sep 2023 20:46:53 +0200 Subject: [PATCH] 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`. --- .../editors/vim/plugins/overrides.nix | 4 +++ .../fix-nix-store-path-regex.patch | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/applications/editors/vim/plugins/patches/vim-sensible/fix-nix-store-path-regex.patch diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 3b948d798760..e8abc87e0677 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -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 ]; }; diff --git a/pkgs/applications/editors/vim/plugins/patches/vim-sensible/fix-nix-store-path-regex.patch b/pkgs/applications/editors/vim/plugins/patches/vim-sensible/fix-nix-store-path-regex.patch new file mode 100644 index 000000000000..27241632ee8d --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/vim-sensible/fix-nix-store-path-regex.patch @@ -0,0 +1,25 @@ +From 07c799a1b170c0e28b385474b511c1034cfcb263 Mon Sep 17 00:00:00 2001 +From: Janik H +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 +