summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua')
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua44
1 files changed, 41 insertions, 3 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua
index c1a7108..00d04b5 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua
@@ -10,9 +10,6 @@ return {
})
end,
config = function()
- -- Load urlview
- require("urlview").setup({})
-
-- Define custom search for thesiah_urls
local thesiah = require("urlview.search")
thesiah["thesiah_urls"] = function()
@@ -80,6 +77,47 @@ return {
return urls
end
+ local actions = require("urlview.actions")
+ actions["firefox_tmux"] = function(url)
+ vim.fn.jobstart({
+ "firefox",
+ "--profile",
+ vim.fn.expand("~/.mozilla/firefox/si.tmux"),
+ url,
+ }, { detach = true })
+ end
+
+ -- Load urlview
+ require("urlview").setup({
+ -- Prompt title (`<context> <default_title>`, e.g. `Buffer Links:`)
+ default_title = "Links:",
+ -- Default picker to display links with
+ -- Options: "native" (vim.ui.select) or "telescope"
+ default_picker = "native",
+ -- Set the default protocol for us to prefix URLs with if they don't start with http/https
+ default_prefix = "https://",
+ -- 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 = actions.firefox_tmux,
+ -- Set the register to use when yanking
+ -- Default: + (system clipboard)
+ default_register = "+",
+ -- Whether plugin URLs should link to the branch used by your package manager
+ default_include_branch = false,
+ -- Ensure links shown in the picker are unique (no duplicates)
+ unique = true,
+ -- Ensure links shown in the picker are sorted alphabetically
+ sorted = true,
+ -- Minimum log level (recommended at least `vim.log.levels.WARN` for error detection warnings)
+ log_level_min = vim.log.levels.INFO,
+ -- Keymaps for jumping to previous / next URL in buffer
+ jump = {
+ prev = "[u",
+ next = "]u",
+ },
+ })
+
-- Add a keymap for the Tmux plugins search context
vim.keymap.set("n", "<leader>ub", "<cmd>UrlView thesiah_urls<cr>", { desc = "Bookmarks URLs" })
vim.keymap.set("n", "<leader>ul", "<cmd>UrlView lazy<cr>", { desc = "Lazy plugin URLs" })