From ea8f79afd7ae5fae519474766e67df82e9968f32 Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 17 Jan 2023 09:50:03 +0100 Subject: [PATCH] feat(vim): add gh-nvim --- flake.nix | 5 +++++ programs/nvim.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/flake.nix b/flake.nix index f3088c8..1d5ff58 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,11 @@ flake = false; }; + gh-nvim = { + url = "github:ldelossa/gh.nvim"; + flake = false; + }; + home-manager = { url = "github:nix-community/home-manager/release-22.11"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/programs/nvim.nix b/programs/nvim.nix index df550b3..59aa0ef 100644 --- a/programs/nvim.nix +++ b/programs/nvim.nix @@ -23,6 +23,7 @@ plugins = buildPlugins [ "cmp-conventionalcommits" "cmp-git" + "gh-nvim" "rust-tools-nvim" ]; in @@ -39,6 +40,7 @@ {plugin = editorconfig-nvim;} {plugin = friendly-snippets;} {plugin = fugitive;} + {plugin = litee-nvim;} # required by gh-nvim {plugin = lualine-lsp-progress;} {plugin = playground;} {plugin = rust-vim;} @@ -78,6 +80,44 @@ ''; } + { + plugin = gh-nvim; + config = '' + lua < ${leader}qcc :GHCloseCommit + nnoremap ${leader}qce :GHExpandCommit + nnoremap ${leader}qct :GHOpenToCommit + nnoremap ${leader}qcp :GHPopOutCommit + nnoremap ${leader}qcz :GHCollapseCommit + + nnoremap ${leader}qip :GHPreviewIssue + + nnoremap ${leader}qrb :GHStartReview + nnoremap ${leader}qrc :GHCloseReview + nnoremap ${leader}qrd :GHDeleteReview + nnoremap ${leader}qre :GHExpandReview + nnoremap ${leader}qrs :GHSubmitReview + nnoremap ${leader}qrz :GHCollapseReview + + nnoremap ${leader}qpc :GHClosePR + nnoremap ${leader}qpd :GHPRDetails + nnoremap ${leader}qpe :GHExpandPR + nnoremap ${leader}qpo :GHOpenPR + nnoremap ${leader}qpp :GHPopOutPR + nnoremap ${leader}qpr :GHRefreshPR + nnoremap ${leader}qpt :GHOpenToPR + nnoremap ${leader}qpz :GHCollapsePR + + nnoremap ${leader}qtc :GHCreateThread + nnoremap ${leader}qtn :GHNextThread + nnoremap ${leader}qt :GHToggleThread + ''; + } + { plugin = lualine-nvim; config = ''