From cf7f87ada697846a38ae3e78eeb8a7066b8679b9 Mon Sep 17 00:00:00 2001 From: s1rens <57037675+S1RENS@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:02:51 +0000 Subject: [PATCH] Add ability to use snacks picker for choosing commands --- README.md | 2 +- lua/obsidian-bridge/network.lua | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 654d2d3..6f7ce40 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ local bridge_settings = { scroll_sync = false, -- See "Sync of buffer scrolling" section below cert_path = nil, -- See "SSL configuration" section below warnings = true, -- Show misconfiguration warnings - picker = "telescope", -- Picker to use with ObsidianBridgePickCommand ("telescope" | "fzf_lua") + picker = "telescope", -- Picker to use with ObsidianBridgePickCommand ("telescope" | "fzf_lua" | "snacks") } -- If you are using lazy in your config, diff --git a/lua/obsidian-bridge/network.lua b/lua/obsidian-bridge/network.lua index 165187a..c2b98db 100644 --- a/lua/obsidian-bridge/network.lua +++ b/lua/obsidian-bridge/network.lua @@ -116,6 +116,20 @@ M.pickers = { fzf_lua.fzf_exec(vim.tbl_keys(command_name_id_map), opts) end, }, + snacks = { + requires = "snacks", + display_name = "snacks.nvim", + pick = function(command_name_id_map, cb) + local items = vim.tbl_keys(command_name_id_map) + Snacks.picker.select(items, { + Prompt = "Obsidian Commands", + }, function(selected) + if selected then + cb(command_name_id_map[selected]) + end + end) + end, + }, } M.pick_command = function(final_config, api_key)