Compare commits

...

3 commits

Author SHA1 Message Date
Antoine Vaure
5f0a2ff631 add devShell to flake template snippet 2025-10-10 14:53:10 +02:00
Antoine Vaure
5fbfe594d9 run darkman specific code only if darkman is available 2025-10-10 14:50:44 +02:00
Antoine Vaure
f65569dc50 add snippet for python 2025-10-08 14:31:08 +02:00
3 changed files with 22 additions and 12 deletions

View file

@ -70,6 +70,7 @@ end
vim.cmd.colorscheme "catppuccin" vim.cmd.colorscheme "catppuccin"
function set_theme_according_to_darkman() function set_theme_according_to_darkman()
if vim.fn.executable("darkman") == 1 then
local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait() local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait()
if obj.code == 0 then if obj.code == 0 then
local theme = "light" local theme = "light"
@ -84,6 +85,7 @@ function set_theme_according_to_darkman()
vim.api.nvim_exec_autocmds("ColorScheme", {}) vim.api.nvim_exec_autocmds("ColorScheme", {})
end end
end end
end
set_theme_according_to_darkman() set_theme_according_to_darkman()
vim.api.nvim_create_autocmd("Signal", { vim.api.nvim_create_autocmd("Signal", {

View file

@ -33,7 +33,7 @@ snippet flake
let let
pkgs = nixpkgs.legacyPackages.\${system}; pkgs = nixpkgs.legacyPackages.\${system};
in in
{ rec {
packages = rec { packages = rec {
$1 = pkgs.stdenv.mkDerivation { $1 = pkgs.stdenv.mkDerivation {
name = "$1"; name = "$1";
@ -43,6 +43,12 @@ snippet flake
}; };
default = $1; default = $1;
}; };
devShells.default = {
inputsFrom = [ packages.default ];
packages = with pkgs; [
$3
];
};
} }
); );
} }

2
snippets/python.snippets Normal file
View file

@ -0,0 +1,2 @@
snippet exception Exception statement
Exception(f"$1")