From d774279c509c6938724daa21df534c305ae3ed6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 22 Nov 2024 15:59:59 +0100 Subject: [PATCH] feat: add more obsidian keybinds --- modules/programs/nvim/new_plugins/obsidian.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/programs/nvim/new_plugins/obsidian.nix b/modules/programs/nvim/new_plugins/obsidian.nix index 70d9f8b..cac1f45 100644 --- a/modules/programs/nvim/new_plugins/obsidian.nix +++ b/modules/programs/nvim/new_plugins/obsidian.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, inputs, ... }: +_: -let - inherit (lib) mkEnableOption mkIf readFile; -in { home-manager.users.moritz.programs.nixvim = { plugins.obsidian = { @@ -23,6 +20,16 @@ in end end ''; + mappings = { + "n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; }; + "q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; }; + "b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; }; + "l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; }; + "e" = { action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; opts.desc = "Extract Note"; opts.buffer = true; }; + "r" = { action.__raw = ''function() return vim.cmd("ObsidianRename") end''; opts.desc = "Rename"; opts.buffer = true; }; + "" = { action.__raw = ''function() return require("obsidian").util.smart_action() end''; opts.buffer = true; opts.expr = true; }; + "gf" = { action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; opts = { noremap = false; expr = true; buffer = true; }; }; + }; }; }; };