From 7114fbeae254712a81e661b19bbbe309b1f83f90 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Thu, 26 Feb 2026 15:01:13 +0100 Subject: [PATCH] obsidian and telescope mini tweaks --- lua/custom/plugins/obsidian.lua | 37 ++++----------------------------- lua/keymaps.lua | 5 +---- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 6f720ad4..92cfb6b7 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -1,43 +1,14 @@ return { 'obsidian-nvim/obsidian.nvim', version = '*', -- use latest release, remove to use latest commit - lazy = true, - event = function() - local vault_path = vim.fn.expand("~/AdisObsidianSyncVault") - return { - "BufReadPre " .. vault_path .. "/**/*.md", - "BufNewFile " .. vault_path .. "/**/*.md", - } - end, - dependencies = { - 'nvim-lua/plenary.nvim', - }, - cmd = { - "ObsidianOpen", - "ObsidianNew", - "ObsidianQuickSwitch", - "ObsidianFollowLink", - "ObsidianBacklinks", - "ObsidianTags", - "ObsidianToday", - "ObsidianYesterday", - "ObsidianTomorrow", - "ObsidianDailies", - "ObsidianTemplate", - "ObsidianSearch", - "ObsidianLink", - "ObsidianLinkNew", - "ObsidianLinks", - "ObsidianExtractNote", - "ObsidianWorkspace", - "ObsidianPasteImg", - "ObsidianRename", - "ObsidianTOC", - }, + ft = 'markdown', ---@module 'obsidian' ---@type obsidian.config opts = { legacy_commands = false, -- this will be removed in the next major release + -- Disable footer to avoid "calling 'backlinks' on bad self" when timer runs + -- after buffer is closed/reused (plugin bug: footer doesn't validate buffer). + footer = { enabled = false }, workspaces = { { name = 'MyOnlyVault', diff --git a/lua/keymaps.lua b/lua/keymaps.lua index ea6434df..6c43f36c 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -42,6 +42,7 @@ map('n', 'gg', ' LazyGit ', { desc = 'start LazyGit' }) map('n', 'd', ' Run/Debug') map('n', 'fe', 'Telescope emoji', { desc = '😃 [F]ind [E]moji' }) +map('n', 'fb', 'Telescope buffers', { desc = '😃 [F]ind [B]uffer' }) map('n', 'l', ' Lsp') map('n', 'lw', function() vim.diagnostic.setloclist() @@ -50,14 +51,10 @@ map('n', 'la', 'lua vim.lsp.buf.code_action()', { desc = 'code map('n', 't', ' Telescope or  Trouble') map('n', 'tr', 'Telescope resume') -map('n', 'o', ' Obsidian') map('n', 'r', ' Render Markdown') map('n', 'rt', 'RenderMarkdown toggle', { desc = 'toggle render markdown', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Increase anti-conceal margin above and below by 1', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Decrease anti-conceal margin above and below by 1', silent = true }) -map('n', 'ot', 'Obsidian today', { silent = true }) -map('n', 'od', 'Obsidian dailies', { silent = true }) -map('n', 'oq', 'Obsidian quick_switch', { silent = true }) map('n', 'e', 'Neotree toggle') map('n', '', 'bn', { desc = 'next buffer' })