diff options
Diffstat (limited to 'ar/.config/TheSiahxyz')
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua index 69e7762..eda7f03 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua @@ -90,7 +90,24 @@ return { -- Command or method to open links with -- Options: "netrw", "system" (default OS browser), "clipboard"; or "firefox", "chromium" etc. -- By default, this is "netrw", or "system" if netrw is disabled - default_action = "system", + -- Use custom function to open URLs asynchronously (prevents blocking) + default_action = function(url) + -- Use vim.ui.open if available (Neovim 0.10+) + if vim.ui.open then + vim.ui.open(url) + else + -- Fallback: detect OS and use appropriate command + local cmd + if vim.fn.has("mac") == 1 then + cmd = "open" + elseif vim.fn.has("win32") == 1 then + cmd = "start" + else + cmd = "xdg-open" + end + vim.fn.jobstart({ cmd, url }, { detach = true }) + end + end, -- Set the register to use when yanking -- Default: + (system clipboard) default_register = "+", |
