From 307fceea38b7352a79b0bdb87025a34b76973867 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:34:13 +0900 Subject: updates --- .../TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua | 149 --------------------- 1 file changed, 149 deletions(-) delete mode 100644 ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua') diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua deleted file mode 100644 index f13a561..0000000 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/urlview.lua +++ /dev/null @@ -1,149 +0,0 @@ -return { - "axieax/urlview.nvim", - dependencies = "nvim-telescope/telescope.nvim", - init = function() - local wk = require("which-key") - wk.add({ - mode = { "n", "v" }, - { "u", group = "URLs" }, - { "uc", group = "Copy URLs" }, - }) - end, - config = function() - -- Define custom search for thesiah_urls - local thesiah = require("urlview.search") - thesiah["thesiah_urls"] = function() - local urls = {} - local files = { - vim.fn.expand("~/.local/share/thesiah/urls"), - vim.fn.expand("~/.local/share/thesiah/snippets"), - } - - -- Check if the file exists and read each file - for _, filepath in ipairs(files) do - if vim.fn.filereadable(filepath) == 1 then - local file = io.open(filepath, "r") - if file then - for line in file:lines() do - -- Match and capture URLs - for url in line:gmatch("https?://[%w%./%-_%%]+") do - table.insert(urls, url) - end - end - file:close() - else - vim.notify("Unable to open " .. filepath, vim.log.levels.ERROR) - end - else - vim.notify("File not found: " .. filepath, vim.log.levels.WARN) - end - end - - return urls - end - - local search = require("urlview.search") - local search_helpers = require("urlview.search.helpers") - - -- Custom search function for Tmux plugins - search["tmux_plugins"] = function() - local urls = {} - local filepath = vim.fn.expand("~/.config/tmux/tmux.conf") - - -- Check if the tmux.conf file exists - if vim.fn.filereadable(filepath) == 1 then - local file = io.open(filepath, "r") - if file then - for line in file:lines() do - -- Match lines that contain Tmux plugin URLs (TPM syntax) - -- Example: set -g @plugin 'tmux-plugins/tpm' - local url = line:match("@plugin%s+'([^']+)'") - if url then - -- Convert to full GitHub URL if not already a full URL - if not url:match("^https?://") then - url = "https://github.com/" .. url - end - table.insert(urls, url) - end - end - file:close() - else - vim.notify("Unable to open " .. filepath, vim.log.levels.ERROR) - end - else - vim.notify("File not found: " .. filepath, vim.log.levels.WARN) - end - - return urls - end - - local actions = require("urlview.actions") - actions["browser_tmux"] = function(url) - local cmd - - if vim.env.TMUX then - local dbus_script = vim.fn.expand("~/.local/bin/tmuxdbussync") - cmd = { - "zsh", - "-lc", - string.format("source %s && setsid -f xdg-open %q", dbus_script, url), - } - else - cmd = { "setsid", "-f", "xdg-open", url } - end - - vim.fn.jobstart(cmd, { detach = true }) - end - - -- Load urlview - require("urlview").setup({ - -- Prompt 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.browser_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", "ub", "UrlView thesiah_urls", { desc = "Bookmarks URLs" }) - vim.keymap.set("n", "ul", "UrlView lazy", { desc = "Lazy plugin URLs" }) - vim.keymap.set("n", "ur", "UrlView", { desc = "Buffer URLs" }) - vim.keymap.set("n", "ut", "UrlView tmux_plugins", { desc = "Tmux plugin URLs" }) - vim.keymap.set( - "n", - "ucb", - "UrlView thesiah_urls action=clipboard", - { desc = "clipboard bookmarks URLs" } - ) - vim.keymap.set("n", "ucl", "UrlView lazy action=clipboard", { desc = "Copy Lazy plugin URLs" }) - vim.keymap.set("n", "ucr", "UrlView action=clipboard", { desc = "Copy buffer URLs" }) - vim.keymap.set( - "n", - "uct", - "UrlView tmux_plugins action=clipboard", - { desc = "clipboard tmux plugin URLs" } - ) - end, -} -- cgit v1.2.3