From 8bfaed4e73d6adcaa72e476b6ab70b2112753511 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 22 Jul 2024 17:55:40 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=99=20Add=20GitLinker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Quickly create (and yank) links to code blocks on git repos - Select text in nvim -> Get link on github - Tweak to hardtime: - Always include hardtime plugin - Toggle 'enabled' setting with .hardtime --- lua/plugins/util.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lua/plugins/util.lua b/lua/plugins/util.lua index 90ffea0..799eb29 100644 --- a/lua/plugins/util.lua +++ b/lua/plugins/util.lua @@ -121,14 +121,34 @@ return { { -- Hardtime "m4xshen/hardtime.nvim", dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, - opts = {}, - cond = function() + opts = function() if vim.fn.readfile(vim.fn.stdpath("config") .. "/.hardtime")[1] == "true" then - return true + return { enabled = true } + else + return { enabled = false } end end, }, + { -- GitLinker + "linrongbin16/gitlinker.nvim", + cmd = "GitLink", + opts = {}, + keys = { + { + "gy", + "GitLink", + mode = { "n", "v" }, + desc = "Yank git link", + }, + { + "gY", + "GitLink!", + mode = { "n", "v" }, + desc = "Open git link", + }, + }, + }, }