From 1b5954dc749e5c44cb77850891a38813d9fe0207 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Oct 2025 16:58:02 +0900 Subject: nvim: open Redmine issue by gx --- .config/nvim/lua/init/04-mappings.lua | 14 ++++++++++++++ home-manager/modules/work.nix | 1 + 2 files changed, 15 insertions(+) diff --git a/.config/nvim/lua/init/04-mappings.lua b/.config/nvim/lua/init/04-mappings.lua index 747cf93..ce13b32 100644 --- a/.config/nvim/lua/init/04-mappings.lua +++ b/.config/nvim/lua/init/04-mappings.lua @@ -509,3 +509,17 @@ K.set('n', 'Z', 'wqall', { nowait = true }) -- `s` is used as a prefix key of plugin sandwich and hop. K.set('n', 's', '') K.set('x', 's', '') + + + +local redmine_host = vim.env.REDMINE_HOST +if redmine_host then + local original_ui_open = vim.ui.open + vim.ui.open = function(path, opt) + if path:match('^#%d+$') then + original_ui_open(('%s/issues/%s'):format(redmine_host, path:sub(2, -1)), opt) + else + original_ui_open(path, opt) + end + end +end diff --git a/home-manager/modules/work.nix b/home-manager/modules/work.nix index 47e0d9e..9de1a21 100644 --- a/home-manager/modules/work.nix +++ b/home-manager/modules/work.nix @@ -7,5 +7,6 @@ { home.sessionVariables = { GITLAB_HOST = "https://gitlab.dcdev.jp"; + REDMINE_HOST = "https://redmine.dcdev.jp"; }; } -- cgit v1.2.3-70-g09d2