From 926ffc9c04613d0a60c46d0fc417244dc318817d Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 19 Aug 2023 20:36:54 +0200 Subject: Fix(hm/conf/neovim/autocmds): Add anchor to space replacement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this the following code would be completely minimized: ``` {...}:{ services.lua_language={ enable=true; }; } ``` → ``` {...}:{ services.lua_language={ enable=true; }; } ```. Now it should only strip the whitespace at the end of the lines. --- home-manager/soispha/config/neovim/nixvim/autocmds/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home-manager/soispha/config/neovim/nixvim/autocmds') diff --git a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix b/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix index c2b64ae3..b1945944 100644 --- a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix +++ b/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix @@ -10,7 +10,7 @@ event = ["BufWritePre"]; pattern = ["*"]; command = '' - ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+//g | endif | 's + ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's ''; description = '' Remove trailing whitespace on safe -- cgit 1.4.1