diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-29 15:42:49 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-29 15:42:49 +0900 |
| commit | 4007d650b739de47e6010daa90a5c74ece1e27aa (patch) | |
| tree | a29216858ea4e5a8abe28d107a0a6be18f94f99c /mac/.config/TheSiahxyz/lua | |
| parent | 440738026e01a60bc24a96d91e4a23e654b87050 (diff) | |
updates
Diffstat (limited to 'mac/.config/TheSiahxyz/lua')
3 files changed, 37 insertions, 6 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/markdown.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/markdown.lua index 3b5c618..a042fc8 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/markdown.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/markdown.lua @@ -223,8 +223,13 @@ return { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, ft = { "markdown" }, - build = function() - vim.fn["mkdp#util#install"]() + build = function(plugin) + if vim.fn.executable("npx") then + vim.cmd("!cd " .. plugin.dir .. " && cd app && npx install") + else + vim.cmd([[Lazy load markdown-preview.nvim]]) + vim.fn["mkdp#util#install"]() + end end, init = function() if vim.fn.executable("npx") then diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua index 1c0fae0..9e60e98 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua @@ -31,6 +31,30 @@ local function find_nvim_plugin_files(prompt_bufnr) end end +local function telescope_open_single_or_multi(bufnr) + local actions = require("telescope.actions") + local actions_state = require("telescope.actions.state") + + local picker = actions_state.get_current_picker(bufnr) + local multi_selection = picker:get_multi_selection() + + if not vim.tbl_isempty(multi_selection) then + actions.close(bufnr) + for _, entry in ipairs(multi_selection) do + if entry.path then + vim.cmd(string.format("edit %s", entry.path)) + end + end + else + -- Only open the file under the cursor if nothing is selected + local entry = actions_state.get_selected_entry() + if entry and entry.path then + actions.close(bufnr) + vim.cmd(string.format("edit %s", entry.path)) + end + end +end + return { { "nvim-telescope/telescope-file-browser.nvim", @@ -549,6 +573,7 @@ return { ["<C-o><C-l>"] = actions.insert_original_cline, ["<M-f>"] = actions.nop, ["<M-k>"] = actions.nop, + ["<CR>"] = telescope_open_single_or_multi, }, n = { ["q"] = actions.close, diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua index b1c72f4..69e7762 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/urlview.lua @@ -1,6 +1,7 @@ return { "axieax/urlview.nvim", dependencies = "nvim-telescope/telescope.nvim", + event = "VeryLazy", init = function() local wk = require("which-key") wk.add({ @@ -89,12 +90,12 @@ 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 = "netrw", + default_action = "system", -- 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, + default_include_branch = true, -- Ensure links shown in the picker are unique (no duplicates) unique = true, -- Ensure links shown in the picker are sorted alphabetically @@ -109,9 +110,9 @@ return { }) -- 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>ub", "<Cmd>UrlView<cr>", { desc = "Buffer URLs" }) vim.keymap.set("n", "<leader>ul", "<Cmd>UrlView lazy<cr>", { desc = "Lazy plugin URLs" }) - vim.keymap.set("n", "<leader>ur", "<Cmd>UrlView<cr>", { desc = "Buffer URLs" }) + vim.keymap.set("n", "<leader>us", "<Cmd>UrlView thesiah_urls<cr>", { desc = "Bookmarks URLs" }) vim.keymap.set("n", "<leader>ut", "<Cmd>UrlView tmux_plugins<cr>", { desc = "Tmux plugin URLs" }) vim.keymap.set( "n", |
