From 8512bbf2cf70f81e95647e50b3c3b9dbc9c8cb0f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 5 Feb 2024 15:42:59 +0100 Subject: [PATCH] nvim: Add existing zettel link insertion mappings Added mapping to insert a link to an existing Zettel with `ni` (note insert), either from normal mode which creates the complete link, or from visual selection mode which surrounds the current selection (as visible link text) with the link. New zettel links still use my own implementation so I have full control over their naming scheme. --- nvim/.config/nvim/lua/plugins/prose.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 4a0334d..7bc7715 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -130,6 +130,19 @@ local prose_plugs = { end, desc = "index page", }, + { + "ni", + function() + require("zk.commands").get("ZkInsertLink")() + end, + desc = "insert link", + }, + { + "ni", + ":'<,'>ZkInsertLinkAtSelection", + mode = "v", + desc = "insert link", + }, }, },