From e4e201390fd19d22ccdc98b43a0c8eb5713a8e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Tue, 19 Mar 2024 21:14:57 +0100 Subject: [PATCH] nvim: fterm - bind glab ci view --- dot_config/nvim/lua/configs/packages/fterm.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dot_config/nvim/lua/configs/packages/fterm.lua b/dot_config/nvim/lua/configs/packages/fterm.lua index 092eccc..a8a7114 100644 --- a/dot_config/nvim/lua/configs/packages/fterm.lua +++ b/dot_config/nvim/lua/configs/packages/fterm.lua @@ -4,6 +4,7 @@ local M = { { 'gg', 'Lazygit', desc = 'Lazygit' }, { 'gh', 'GitHistory', desc = 'Git history' }, { 'gB', 'GitBlame', desc = 'Git Blame' }, + { 'gC', 'GitLabCIView', desc = 'Show gitlab pipeline' }, }, lazy = true, } @@ -46,9 +47,22 @@ function M.config() }) end + local gitlab_ci = function() + local file = vim.api.nvim_buf_get_name(0) + local cmd = 'glab ci view' + fterm.scratch({ + cmd = cmd, + dimensions = { + height = 0.9, + width = 0.9, + }, + }) + end + vim.keymap.set('n', 'Lazygit', function() lazygit:toggle() end, { desc = 'Toggle lazygit' }) vim.keymap.set('n', 'GitHistory', git_history, { desc = 'Show git history' }) vim.keymap.set('n', 'GitBlame', git_blame, { desc = 'Show git blame' }) + vim.keymap.set('n', 'GitLabCIView', gitlab_ci, { desc = 'Show gitlab pipeline' }) end return M