neovim: mapping obsidian option init

This commit is contained in:
ooks-io 2025-01-06 21:54:31 +11:00
parent c4053ad9c1
commit 779b437a13
4 changed files with 37 additions and 0 deletions

View file

@ -2,5 +2,6 @@
imports = [
./gruvbox-material
./telescope
./obsidian
];
}

View file

@ -0,0 +1,21 @@
{
config,
lib,
options,
...
}: let
inherit (lib) mkIf;
inherit (lib.nvim.binds) mkKeymap;
inherit (options.vim.notes.obsidian) mappings;
cfg = config.vim.notes.obsidian;
keys = cfg.mappings;
in {
config = mkIf cfg.enable {
vim = {
keymaps = [
(mkKeymap "n" keys.openNote "<cmd>ObsidianOpen<CR>" {desc = mappings.openNote.description;})
];
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./obsidian.nix
];
}

View file

@ -0,0 +1,9 @@
{lib, ...}: let
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.notes.obsidian = {
mappings = {
openNote = mkMappingOption "Open obsidian note" "<leader>oo";
};
};
}