From aee90917d94120577d39e1c6753f517c9b8fc4e6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 13 Jun 2025 01:36:54 +0100 Subject: [PATCH] Don't automatically save/close Harpoon windows --- .../coding/neovim/config/plugins/auto-save.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/home-manager/coding/neovim/config/plugins/auto-save.nix b/modules/home-manager/coding/neovim/config/plugins/auto-save.nix index 98b93b63..d43e22f1 100644 --- a/modules/home-manager/coding/neovim/config/plugins/auto-save.nix +++ b/modules/home-manager/coding/neovim/config/plugins/auto-save.nix @@ -1,3 +1,21 @@ { plugins.auto-save.enable = true; + + plugins.auto-save.settings.condition = '' + function(buf) + local excluded_filetypes = { + "harpoon" + } + + local excluded_filenames = {} + + if vim.tbl_contains(excluded_filetypes, vim.fn.getbufvar(buf, "&filetype")) + or vim.tbl_contains(excluded_filenames, vim.fn.expand("%:t")) + then + return false + end + + return true + end + ''; }