mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
Add follow_url_fallback config option (#172)
* Add follow_link_fallback config option * Update README.md * Rename follow_link_fallback to follow_url_fallback. Change logic of configuring
This commit is contained in:
committed by
GitHub
parent
923274dfb8
commit
60808e8e59
@@ -156,6 +156,9 @@ local function defaultConfig(home)
|
||||
-- "catimg-previewer" if you have catimg installed
|
||||
-- "viu-previewer" if you have viu installed
|
||||
media_previewer = "telescope-media-files",
|
||||
|
||||
-- A customizable fallback handler for urls.
|
||||
follow_url_fallback = nil,
|
||||
}
|
||||
M.Cfg = cfg
|
||||
M.note_type_templates = {
|
||||
@@ -1473,6 +1476,11 @@ local function check_for_link_or_tag()
|
||||
end
|
||||
|
||||
local function follow_url(url)
|
||||
if M.Cfg.follow_url_fallback then
|
||||
local cmd = string.gsub(M.Cfg.follow_url_fallback, "{{url}}", url)
|
||||
return vim.cmd(cmd)
|
||||
end
|
||||
|
||||
-- we just leave it to the OS's handler to deal with what kind of URL it is
|
||||
local function format_command(cmd)
|
||||
return 'call jobstart(["'
|
||||
|
||||
Reference in New Issue
Block a user