From bd3d2d594a740e94db2af4818126ea4a0c76bf3a Mon Sep 17 00:00:00 2001 From: handdara Date: Thu, 28 Nov 2024 12:34:06 -0500 Subject: [PATCH] Add obsidian plugin --- fst/hez/wezterm-main/handdara/fonts.lua | 20 +- fst/hez/wezterm-main/handdara/looks.lua | 7 +- fst/him/nvim-nrw/after/ftplugin/markdown.lua | 25 +- .../nvim-nrw/after/ftplugin/telekasten.lua | 17 +- fst/him/nvim-nrw/init.lua | 4 +- fst/him/nvim-nrw/lazy-lock.json | 23 +- fst/him/nvim-nrw/lua/handdara/carrot.lua | 4 + fst/him/nvim-nrw/lua/handdara/config/set.lua | 1 + fst/him/nvim-nrw/lua/handdara/obsidian.lua | 32 +++ .../lua/handdara/plugins/obsidian.lua | 244 +++++++++++++++++- 10 files changed, 332 insertions(+), 45 deletions(-) create mode 100644 fst/him/nvim-nrw/lua/handdara/obsidian.lua diff --git a/fst/hez/wezterm-main/handdara/fonts.lua b/fst/hez/wezterm-main/handdara/fonts.lua index 4714dfe..c8dfe41 100644 --- a/fst/hez/wezterm-main/handdara/fonts.lua +++ b/fst/hez/wezterm-main/handdara/fonts.lua @@ -1,30 +1,32 @@ local wezterm = require('wezterm') +local sym_fallback = { family = 'Symbols Nerd Font', scale = 1 } return { hasklug = wezterm.font_with_fallback({ { family = 'Hasklug Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, + sym_fallback, }), monofur = wezterm.font_with_fallback({ { family = 'Monofur Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, + sym_fallback, }), monoid = wezterm.font_with_fallback({ { family = 'Monoid Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, + sym_fallback, }), f3270 = wezterm.font_with_fallback({ { family = '3270 Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, + sym_fallback, }), agave = wezterm.font_with_fallback({ { family = 'Agave Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, - }), - spacemono = wezterm.font_with_fallback({ - { family = 'SpaceMono Nerd Font', weight = 'Regular' }, - { family = 'Symbols Nerd Font Mono', scale = 1 }, + sym_fallback, }), + spacemono = wezterm.font 'SpaceMono Nerd Font', + -- spacemono = wezterm.font_with_fallback({ + -- { family = 'SpaceMono Nerd Font', weight = 'Regular' }, + -- sym_fallback, + -- }), firacode = wezterm.font 'Fira Code', jetbrains = wezterm.font 'JetBrains Mono', } diff --git a/fst/hez/wezterm-main/handdara/looks.lua b/fst/hez/wezterm-main/handdara/looks.lua index d624314..a6b90c6 100644 --- a/fst/hez/wezterm-main/handdara/looks.lua +++ b/fst/hez/wezterm-main/handdara/looks.lua @@ -12,13 +12,12 @@ local function apply_to_config(config) } -- fonts and window settings - local default_font = hf.spacemono - local default_font_size = 15.0 - config.font = default_font + local default_font_size = 13.0 + config.font = hf.agave config.font_size = default_font_size config.enable_tab_bar = false -- making the window layout simple, 99 times out of 100 scaling is handled config.window_frame = { - font = hf.hasklug, + font = hf.agave, font_size = default_font_size - 1, } diff --git a/fst/him/nvim-nrw/after/ftplugin/markdown.lua b/fst/him/nvim-nrw/after/ftplugin/markdown.lua index 1150426..f6fd79a 100644 --- a/fst/him/nvim-nrw/after/ftplugin/markdown.lua +++ b/fst/him/nvim-nrw/after/ftplugin/markdown.lua @@ -1,16 +1,23 @@ local map = vim.keymap.set -vim.opt_local.conceallevel = 0 +local wikilink_regex = '\\[\\[.*\\]\\]' +local mdlink_regex = '\\[[^]]*\\](.*)' +local link_regex = [[\(]].. wikilink_regex ..[[\|]].. mdlink_regex ..[[\)]] map('n', 'it', 'r!todayi##_', { buffer = true, desc = '[i]nsert [t]oday\'s date as heading' }) map('v', 't', '!pandoc -t gfm', { buffer = true, desc = 'format highlighted [T]able' }) map('v', 'T', '!pandoc -t markdown_strict+grid_tables', { buffer = true, desc = 'format highlighted [T]able' }) map('n', 'gt', 'vip!pandoc -t ', { buffer = true }) -vim.keymap.set('n', 'nt', function() - local lc = vim.api.nvim_get_option_value('conceallevel', {}) - if lc == 0 then - vim.opt_local.conceallevel = 2 - else - vim.opt_local.conceallevel = 0 - end -end, { desc = '[n]otes [t]oggle conceal' , buffer = true}) +-- vim.opt_local.conceallevel = 1 +-- vim.keymap.set('n', 'nt', function() +-- local lc = vim.api.nvim_get_option_value('conceallevel', {}) +-- if lc == 0 then +-- vim.opt_local.conceallevel = 1 +-- else +-- vim.opt_local.conceallevel = 0 +-- end +-- end, { desc = '[n]otes [t]oggle conceal' , buffer = true}) +map('n', '', '/'.. wikilink_regex ..'zz', { desc = 'go to next link', buffer = true }) +map('n', '', '?'.. wikilink_regex ..'zz', { desc = 'go to prev link', buffer = true }) +map('n', '', '/'.. link_regex ..'zz', { desc = 'go to next link', buffer = true }) +map('n', '', '?'.. link_regex ..'zz', { desc = 'go to prev link', buffer = true }) diff --git a/fst/him/nvim-nrw/after/ftplugin/telekasten.lua b/fst/him/nvim-nrw/after/ftplugin/telekasten.lua index cd0c752..37c75f7 100644 --- a/fst/him/nvim-nrw/after/ftplugin/telekasten.lua +++ b/fst/him/nvim-nrw/after/ftplugin/telekasten.lua @@ -1,18 +1,19 @@ local wikilink_regex = '\\[\\[.*\\]\\]' local mdlink_regex = '\\[[^]]*\\](.*)' local link_regex = [[\(]].. wikilink_regex ..[[\|]].. mdlink_regex ..[[\)]] + vim.keymap.set('n', '', '/'.. wikilink_regex ..'zz', { desc = 'go to next link', buffer = true }) vim.keymap.set('n', '', '?'.. wikilink_regex ..'zz', { desc = 'go to prev link', buffer = true }) vim.keymap.set('n', '', '/'.. link_regex ..'zz', { desc = 'go to next link', buffer = true }) vim.keymap.set('n', '', '?'.. link_regex ..'zz', { desc = 'go to prev link', buffer = true }) -vim.keymap.set('n', 'nt', function() - local lc = vim.api.nvim_get_option_value('conceallevel', {}) - if lc == 0 then - vim.opt_local.conceallevel = 2 - else - vim.opt_local.conceallevel = 0 - end -end, { desc = '[n]otes [t]oggle conceal' , buffer = true}) +-- vim.keymap.set('n', 'nt', function() +-- local lc = vim.api.nvim_get_option_value('conceallevel', {}) +-- if lc == 0 then +-- vim.opt_local.conceallevel = 2 +-- else +-- vim.opt_local.conceallevel = 0 +-- end +-- end, { desc = '[n]otes [t]oggle conceal' , buffer = true}) vim.cmd [[hi link tkTag Constant]] -- custom highlights -- vim.cmd [[hi link tkHighlight @comment.note]] vim.cmd [[hi link tkHighlight Visual]] diff --git a/fst/him/nvim-nrw/init.lua b/fst/him/nvim-nrw/init.lua index b01bbfc..2b101ab 100644 --- a/fst/him/nvim-nrw/init.lua +++ b/fst/him/nvim-nrw/init.lua @@ -33,10 +33,10 @@ vim.cmd('colorscheme ' .. inital_colorscheme) require 'handdara'.setup { -- colorscheme = "rose-pine-moon", - colorscheme = { name = "rose-pine-dawn", is_light = true }, + -- colorscheme = { name = "rose-pine-dawn", is_light = true }, -- colorscheme = "darkrose", -- colorscheme = "lunaperche", -- colorscheme = "archery", -- colorscheme = "tmp-archery", - -- colorscheme = "marrissa", + colorscheme = "marrissa", } diff --git a/fst/him/nvim-nrw/lazy-lock.json b/fst/him/nvim-nrw/lazy-lock.json index 16d703a..b1a5876 100644 --- a/fst/him/nvim-nrw/lazy-lock.json +++ b/fst/him/nvim-nrw/lazy-lock.json @@ -1,6 +1,5 @@ { "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, "carrot.nvim": { "branch": "main", "commit": "722b9bf195fc6bccbf8151c22fb2275386f41e08" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -11,28 +10,28 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "due.nvim": { "branch": "main", "commit": "70a93319fa0345c116f2b57cf1f99e0d20026c5e" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, - "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, + "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "mini.files": { "branch": "main", "commit": "6abe854f1410fc6aec69897a78b1db994c32d9c6" }, "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, - "neogit": { "branch": "master", "commit": "89d13fb9898619774d359a3900959181d60dd02f" }, - "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, - "nvim-lspconfig": { "branch": "master", "commit": "87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "06611c75fec573420838369fe76ac5f8bd740240" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" }, - "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "neogit": { "branch": "master", "commit": "c3a1e8f1b568c7ea844645bc327c22908ea3df68" }, + "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, + "nvim-lspconfig": { "branch": "master", "commit": "e869c7e6af0a3c40a2b344a9765779d74dd12720" }, + "nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" }, + "nvim-treesitter": { "branch": "master", "commit": "427a90ae70f66c2fdf2d9ad16a0f08e9697d90d9" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" }, - "telekasten.nvim": { "branch": "main", "commit": "6a10a7929421d6e696e46bbc5aa5627a8cbcf61d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, - "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" } + "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" } } diff --git a/fst/him/nvim-nrw/lua/handdara/carrot.lua b/fst/him/nvim-nrw/lua/handdara/carrot.lua index 184cb68..48084e5 100644 --- a/fst/him/nvim-nrw/lua/handdara/carrot.lua +++ b/fst/him/nvim-nrw/lua/handdara/carrot.lua @@ -8,6 +8,8 @@ vim.keymap.set('n', 'ce', function () vim.bo.filetype = prev_ft vim.cmd 'write' vim.cmd 'edit' + elseif prev_ft == "markdown" then + c.execute_normal() end end, { desc = '[c]arrot: [e]val code block' }) vim.keymap.set('n', 'cE', function () @@ -18,5 +20,7 @@ vim.keymap.set('n', 'cE', function () vim.bo.filetype = prev_ft vim.cmd 'write' vim.cmd 'edit' + elseif prev_ft == "markdown" then + c.execute_all() end end, { desc = '[c]arrot: [E]val all code block' }) diff --git a/fst/him/nvim-nrw/lua/handdara/config/set.lua b/fst/him/nvim-nrw/lua/handdara/config/set.lua index 8c797e9..9d3f1fb 100644 --- a/fst/him/nvim-nrw/lua/handdara/config/set.lua +++ b/fst/him/nvim-nrw/lua/handdara/config/set.lua @@ -1,4 +1,5 @@ return function() + vim.o.conceallevel = 1 vim.o.breakindent = true -- Enable break indent vim.o.expandtab = true vim.o.hlsearch = false -- highlight on search diff --git a/fst/him/nvim-nrw/lua/handdara/obsidian.lua b/fst/him/nvim-nrw/lua/handdara/obsidian.lua new file mode 100644 index 0000000..95fa6a8 --- /dev/null +++ b/fst/him/nvim-nrw/lua/handdara/obsidian.lua @@ -0,0 +1,32 @@ +-- THIS IS CALLED ON VIM INIT, NOT LAZY CONFIG! +local map = vim.keymap.set +local maps = { + ["nx"] = { + modes = 'v', + action = ":ObsidianExtractNote", + opts = { buffer = true }, + }, + ["nln"] = { + modes = 'v', + action = ":ObsidianLinkNew", + opts = {}, + }, + ["nll"] = { + modes = 'v', + action = ":ObsidianLink", + opts = { buffer = true }, + }, + ["na"] = { + modes = 'n', + action = ":ObsidianToday", + opts = {}, + }, + ["nf"] = { + modes = 'n', + action = ":ObsidianQuickSwitch", + opts = {}, + }, +} +for combos, dat in pairs(maps) do + map(dat.modes, combos, dat.action, dat.opts ) +end diff --git a/fst/him/nvim-nrw/lua/handdara/plugins/obsidian.lua b/fst/him/nvim-nrw/lua/handdara/plugins/obsidian.lua index 712d4fe..cde1dd8 100644 --- a/fst/him/nvim-nrw/lua/handdara/plugins/obsidian.lua +++ b/fst/him/nvim-nrw/lua/handdara/plugins/obsidian.lua @@ -1,15 +1,257 @@ +---@diagnostic disable: unused-local local ansible_path = vim.fn.expand("~/MEGA/ansible") + +-- local pomo_opts = { +-- -- How often the notifiers are updated. +-- update_interval = 1000, +-- -- Configure the default notifiers to use for each timer. +-- -- You can also configure different notifiers for timers given specific names, see +-- -- the 'timers' field below. +-- notifiers = { +-- -- The "Default" notifier uses 'vim.notify' and works best when you have 'nvim-notify' installed. +-- { +-- name = "Default", +-- opts = { +-- -- With 'nvim-notify', when 'sticky = true' you'll have a live timer pop-up +-- -- continuously displayed. If you only want a pop-up notification when the timer starts +-- -- and finishes, set this to false. +-- sticky = true, +-- -- Configure the display icons: +-- title_icon = "", +-- text_icon = "", +-- -- Replace the above with these if you don't have a patched font: +-- -- title_icon = "⏳", +-- -- text_icon = "⏱️", +-- }, +-- }, +-- -- The "System" notifier sends a system notification when the timer is finished. +-- -- Available on MacOS and Windows natively and on Linux via the `libnotify-bin` package. +-- { name = "System" }, +-- -- You can also define custom notifiers by providing an "init" function instead of a name. +-- -- { init = function(timer) ... end } +-- }, +-- -- Override the notifiers for specific timer names. +-- timers = { +-- -- For example, use only the "System" notifier when you create a timer called "Break", +-- -- e.g. ':TimerStart 2m Break'. +-- Break = { +-- { name = "System" }, +-- }, +-- }, +-- -- You can optionally define custom timer sessions. +-- sessions = { +-- -- Example session configuration for a session called "pomodoro". +-- pomodoro = { +-- { name = "Work", duration = "25m" }, +-- { name = "Short Break", duration = "5m" }, +-- { name = "Work", duration = "25m" }, +-- { name = "Short Break", duration = "5m" }, +-- { name = "Work", duration = "25m" }, +-- { name = "Long Break", duration = "15m" }, +-- }, +-- }, +-- } + return { "epwalsh/obsidian.nvim", version = "*", - lazy = true, + -- lazy = true, ft = "markdown", + event = "VeryLazy", dependencies = { 'nvim-lua/plenary.nvim', + -- optional dependencies below + 'hrsh7th/nvim-cmp', + 'nvim-telescope/telescope.nvim', + 'nvim-treesitter/nvim-treesitter', + -- { + -- "epwalsh/pomo.nvim", + -- version = "*", -- Recommended, use latest release instead of latest commit + -- lazy = true, + -- cmd = { "TimerStart", "TimerRepeat", "TimerSession" }, + -- opts = pomo_opts, + -- }, + -- 'rcarriga/nvim-notify', -- for pomo.nvim, optional, but highly recommended if you want to use the "Default" timer }, + init = function() + require 'handdara.obsidian' + end, opts = { workspaces = { { name = "ansible", path = ansible_path }, }, + daily_notes = { + folder = '0-quest-board/dailies' + }, + completion = { + -- Set to false to disable completion. + nvim_cmp = true, + }, + notes_subdir = "0-quest-board/inbox", + mappings = { -- Optional, configure key mappings. These are the defaults. + -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. + ["gf"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + [""] = { -- the ch mapping was the original + action = "ObsidianToggleCheckbox", + opts = { buffer = true }, + }, + ["nt"] = { + action = "ObsidianTags", + opts = { buffer = true }, + }, + ["nb"] = { + action = "ObsidianBacklinks", + opts = { buffer = true }, + }, + ["ng"] = { + action = "ObsidianSearch", + opts = { buffer = true }, + }, + ["nc"] = { + action = "ObsidianTOC", + opts = { buffer = true }, + }, + ["nls"] = { + action = "ObsidianLinks", + opts = { buffer = true }, + }, + }, + + -- Where to put new notes. Valid options are + -- * "current_dir" - put new notes in same directory as the current buffer. + -- * "notes_subdir" - put new notes in the default notes subdirectory. + new_notes_location = "notes_subdir", + -- customize how note file names are generated given the ID, target directory, and title + ---@param spec { id: string, dir: obsidian.Path, title: string|? } + ---@return string|obsidian.Path The full path to the new note. + note_path_func = function(spec) + if spec.title then + local path = spec.dir / tostring(spec.title) + else + local path = spec.dir / tostring(spec.id) + end + return path:with_suffix(".md") + end, + + preferred_link_style = "wiki", -- Either 'wiki' or 'markdown'. + disable_frontmatter = true, + -- templates = { -- Optional, for templates (see below). + -- folder = "templates", + -- date_format = "%Y-%m-%d", + -- time_format = "%H:%M", + -- -- A map for custom variables, the key should be the variable and the value a function + -- substitutions = {}, + -- }, + picker = { + name = "telescope.nvim", -- Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'. + -- mappings = { + -- new = "", -- Create a new note from your query. + -- insert_link = "", -- Insert a link to the selected note. + -- }, + }, + -- Optional, sort search results by "path", "modified", "accessed", or "created". + -- The recommend value is "modified" and `true` for `sort_reversed`, which means, for example, + -- that `:ObsidianQuickSwitch` will show the notes sorted by latest modified time + sort_by = "modified", + sort_reversed = true, + + -- Optional, define your own callbacks to further customize behavior. + callbacks = { + -- Runs at the end of `require("obsidian").setup()`. + ---@param client obsidian.Client + post_setup = function(client) end, + + -- Runs anytime you enter the buffer for a note. + ---@param client obsidian.Client + ---@param note obsidian.Note + enter_note = function(client, note) end, + + -- Runs anytime you leave the buffer for a note. + ---@param client obsidian.Client + ---@param note obsidian.Note + leave_note = function(client, note) end, + + -- Runs right before writing the buffer for a note. + ---@param client obsidian.Client + ---@param note obsidian.Note + pre_write_note = function(client, note) end, + + -- Runs anytime the workspace is set/changed. + ---@param client obsidian.Client + ---@param workspace obsidian.Workspace + post_set_workspace = function(client, workspace) end, + }, + + -- Optional, configure additional syntax highlighting / extmarks. + -- This requires you have `conceallevel` set to 1 or 2. See `:help conceallevel` for more details. + ui = { + enable = true, -- set to false to disable all additional syntax features + update_debounce = 200, -- update delay after a text change (in milliseconds) + max_file_length = 5000, -- disable UI features for files with more than this many lines + -- Define how various check-boxes are displayed + checkboxes = { + -- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below. + -- You can also add more custom ones... + [" "] = { char = "", hl_group = "ObsidianTodo" }, + ["x"] = { char = "", hl_group = "ObsidianDone" }, + [">"] = { char = "󰄚", hl_group = "ObsidianRightArrow" }, + ["~"] = { char = "", hl_group = "ObsidianTilde" }, + ["!"] = { char = "", hl_group = "ObsidianImportant" }, + ["-"] = { char = "", hl_group = "ObsidianDelayed" }, + ["."] = { char = "", hl_group = "ObsidianInProg" }, + }, + -- Use bullet marks for non-checkbox lists. + bullets = { char = "󰾡", hl_group = "ObsidianBullet" }, + external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" }, + -- Replace the above with this if you don't have a patched font: + -- external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" }, + reference_text = { hl_group = "ObsidianRefText" }, + highlight_text = { hl_group = "ObsidianHighlightText" }, + tags = { hl_group = "ObsidianTag" }, + block_ids = { hl_group = "ObsidianBlockID" }, + hl_groups = { + -- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`. + ObsidianTodo = { bold = true, fg = "#939393" }, + ObsidianDone = { bold = true, fg = "#236b2a" }, + ObsidianRightArrow = { bold = true, fg = "#686868" }, + ObsidianTilde = { bold = true, fg = "#ce0a04" }, + ObsidianImportant = { bold = true, fg = "#f9bb01" }, + ObsidianDelayed = { bold = true, fg = "#302de2" }, + ObsidianInProg = {bold = true, fg = "#f96c00"}, + ObsidianBullet = { bold = true, fg = "#89ddff" }, + ObsidianRefText = { underline = true, fg = "#c792ea" }, + ObsidianExtLinkIcon = { fg = "#c792ea" }, + ObsidianTag = { italic = true, fg = "#89ddff" }, + ObsidianBlockID = { italic = true, fg = "#89ddff" }, + ObsidianHighlightText = { bg = "#75662e" }, + }, + }, + + -- Specify how to handle attachments. + attachments = { + -- The default folder to place images in via `:ObsidianPasteImg`. + -- If this is a relative path it will be interpreted as relative to the vault root. + -- You can always override this per image by passing a full path to the command instead of just a filename. + img_folder = "assets/imgs", -- This is the default + -- A function that determines the text to insert in the note when pasting an image. + -- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file. + -- This is the default implementation. + ---@param client obsidian.Client + ---@param path obsidian.Path the absolute path to the image file + ---@return string + img_text_func = function(client, path) + path = client:vault_relative_path(path) or path + return string.format("![%s](%s)", path.name, path) + end, + }, + -- Optional, set to true if you use the Obsidian Advanced URI plugin. + -- https://github.com/Vinzent03/obsidian-advanced-uri + -- use_advanced_uri = false, + open_app_foreground = true, -- Optional, set to true to force ':ObsidianOpen' to bring the app to the foreground. }, }