From 62d2d09938df32027e984ffb5c67013fa82fc493 Mon Sep 17 00:00:00 2001 From: Arthur McLain Date: Sat, 2 Dec 2023 05:12:38 +0100 Subject: [PATCH 1/2] feat(plugins): add harpoon support --- README.md | 3 ++- lua/astrotheme/groups/plugins/harpoon.lua | 30 +++++++++++++++++++++++ lua/astrotheme/groups/plugins/init.lua | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 lua/astrotheme/groups/plugins/harpoon.lua diff --git a/README.md b/README.md index bb8bf9e..c93a94e 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,8 @@ term.foreground | [dashboard-nvim](https://github.com/glepnir/dashboard-nvim) | `dashboard-nvim` | | [flash.nvim](https://github.com/folke/flash.nvim) | `flash` | | [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) | `gitsigns` | -| [hop.nvim](https://github.com/phaazon/hop.nvim/) | `hop` | +| [harpoon](https://github.com/ThePrimeagen/harpoon) | `harpoon` | +| [hop.nvim](https://github.com/phaazon/hop.nvim) | `hop` | | [indent_blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) | `indent-blankline` | | [lightspeed.nvim](https://github.com/ggandor/lightspeed.nvim) | `lightspeed` | | [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) | `lualine` | diff --git a/lua/astrotheme/groups/plugins/harpoon.lua b/lua/astrotheme/groups/plugins/harpoon.lua new file mode 100644 index 0000000..4876116 --- /dev/null +++ b/lua/astrotheme/groups/plugins/harpoon.lua @@ -0,0 +1,30 @@ +local function callback(opts) + return { + HarpoonWindow = { + fg = C.ui.text, + bg = (opts.border and opts.inactive and C.ui.base) + or (opts.border and opts.float and C.ui.base) + or (opts.inactive and C.ui.prompt) + or (opts.float and C.ui.prompt) + or (opts.transparent and C.none) + or C.ui.base, + blend = vim.o.winblend or 0, + }, + HarpoonBorder = { + fg = (opts.border and C.ui.border) or (opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.base, + bg = (opts.border and opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.prompt, + blend = vim.o.winblend or 0, + }, + HarpoonTitle = { + fg = (opts.title_invert and C.ui.float) or C.ui.title, + bg = (opts.title_invert and C.ui.title) + or (opts.float and C.ui.prompt) + or (opts.transparent and C.none) + or C.ui.base, + blend = vim.o.winblend or 0, + bold = true, + }, + } +end + +return callback diff --git a/lua/astrotheme/groups/plugins/init.lua b/lua/astrotheme/groups/plugins/init.lua index 13296e5..dc66781 100644 --- a/lua/astrotheme/groups/plugins/init.lua +++ b/lua/astrotheme/groups/plugins/init.lua @@ -5,6 +5,7 @@ return { ["dashboard-nvim"] = "dashboard-nvim", ["flash.nvim"] = "flash", ["gitsigns.nvim"] = "gitsigns", + ["harpoon"] = "harpoon", ["hop.nvim"] = "hop", ["indent-blankline.nvim"] = "indent-blankline", ["neogit"] = "neogit", From dfac7f05807cc66a8fa608741172386a925d11c1 Mon Sep 17 00:00:00 2001 From: Arthur McLain Date: Mon, 4 Dec 2023 05:05:14 +0100 Subject: [PATCH 2/2] feat: link harpoon highlights to existing groups --- lua/astrotheme/groups/plugins/harpoon.lua | 29 ++++------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/lua/astrotheme/groups/plugins/harpoon.lua b/lua/astrotheme/groups/plugins/harpoon.lua index 4876116..657a352 100644 --- a/lua/astrotheme/groups/plugins/harpoon.lua +++ b/lua/astrotheme/groups/plugins/harpoon.lua @@ -1,29 +1,8 @@ -local function callback(opts) +local function callback() return { - HarpoonWindow = { - fg = C.ui.text, - bg = (opts.border and opts.inactive and C.ui.base) - or (opts.border and opts.float and C.ui.base) - or (opts.inactive and C.ui.prompt) - or (opts.float and C.ui.prompt) - or (opts.transparent and C.none) - or C.ui.base, - blend = vim.o.winblend or 0, - }, - HarpoonBorder = { - fg = (opts.border and C.ui.border) or (opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.base, - bg = (opts.border and opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.prompt, - blend = vim.o.winblend or 0, - }, - HarpoonTitle = { - fg = (opts.title_invert and C.ui.float) or C.ui.title, - bg = (opts.title_invert and C.ui.title) - or (opts.float and C.ui.prompt) - or (opts.transparent and C.none) - or C.ui.base, - blend = vim.o.winblend or 0, - bold = true, - }, + HarpoonWindow = { link = "NormalFloat" }, + HarpoonBorder = { link = "FloatBorder" }, + HarpoonTitle = { link = "FloatTitle" }, } end