From f65569dc50968f92cee4719cac327b950d038792 Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Wed, 8 Oct 2025 14:31:08 +0200 Subject: [PATCH 1/3] add snippet for python --- snippets/python.snippets | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 snippets/python.snippets diff --git a/snippets/python.snippets b/snippets/python.snippets new file mode 100644 index 0000000..13c5f33 --- /dev/null +++ b/snippets/python.snippets @@ -0,0 +1,2 @@ +snippet exception Exception statement + Exception(f"$1") From 5fbfe594d9bae90913d5b2d11a96193606b6b1a7 Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Fri, 10 Oct 2025 14:50:44 +0200 Subject: [PATCH 2/3] run darkman specific code only if darkman is available --- init.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 90e718f..33a4ed5 100644 --- a/init.lua +++ b/init.lua @@ -70,18 +70,20 @@ end vim.cmd.colorscheme "catppuccin" function set_theme_according_to_darkman() - local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait() - if obj.code == 0 then - local theme = "light" - if obj.stdout == "dark\n" then - theme = "dark" - end - if obj.stdout == "light\n" then - theme = "light" - end + if vim.fn.executable("darkman") == 1 then + local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait() + if obj.code == 0 then + local theme = "light" + if obj.stdout == "dark\n" then + theme = "dark" + end + if obj.stdout == "light\n" then + theme = "light" + end - opt.background = theme - vim.api.nvim_exec_autocmds("ColorScheme", {}) + opt.background = theme + vim.api.nvim_exec_autocmds("ColorScheme", {}) + end end end From 5f0a2ff63120e0e5dba7cf79054bc2bec6b446aa Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Fri, 10 Oct 2025 14:53:10 +0200 Subject: [PATCH 3/3] add devShell to flake template snippet --- snippets/nix.snippets | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snippets/nix.snippets b/snippets/nix.snippets index 5a37be1..198f9e7 100644 --- a/snippets/nix.snippets +++ b/snippets/nix.snippets @@ -33,7 +33,7 @@ snippet flake let pkgs = nixpkgs.legacyPackages.\${system}; in - { + rec { packages = rec { $1 = pkgs.stdenv.mkDerivation { name = "$1"; @@ -43,6 +43,12 @@ snippet flake }; default = $1; }; + devShells.default = { + inputsFrom = [ packages.default ]; + packages = with pkgs; [ + $3 + ]; + }; } ); }