mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2026-02-04 06:42:05 +00:00
Update 2025-03-30
Update 2025-03-08 Update 2025-03-09 Update 2025-03-10 Update 2025-03-12 Update 2025-03-15 Update 2025-03-16 Update 2025-03-17 Update 2025-03-18 Update 2025-03-21 Update 2025-03-23 Update 2025-03-27 Update 2025-03-28 Update 2025-03-30
This commit is contained in:
@@ -8,22 +8,26 @@ return {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
only_render_image_at_cursor = true,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
only_render_image_at_cursor = true,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
typst = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
only_render_image_at_cursor = true,
|
||||
filetypes = { "typst" },
|
||||
},
|
||||
html = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
only_render_image_at_cursor = true,
|
||||
},
|
||||
css = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
only_render_image_at_cursor = true,
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
@@ -35,5 +39,26 @@ return {
|
||||
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
|
||||
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
|
||||
resolve_image_path = function(document_path, image_path, fallback)
|
||||
-- Define the absolute path to your Assets directory
|
||||
local assets_dir = vim.fn.expand("~/Obsidian/assets/img/")
|
||||
|
||||
-- Check if the image_path is already an absolute path
|
||||
if image_path:match("^/") then
|
||||
-- If it's an absolute path, leave it unchanged
|
||||
return image_path
|
||||
end
|
||||
|
||||
-- Construct the new image path by prepending the Assets directory
|
||||
local new_image_path = assets_dir .. "/" .. image_path
|
||||
|
||||
-- Check if the constructed path exists
|
||||
if vim.fn.filereadable(new_image_path) == 1 then
|
||||
return new_image_path
|
||||
else
|
||||
-- If the file doesn't exist in Assets, fallback to default behavior
|
||||
return fallback(document_path, image_path)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user