From 9ba07e134d35c19accb55a1ae1004f957e80604a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Mon, 8 Mar 2021 10:46:42 +0100 Subject: [PATCH] Fix fugitive lua extensions push and pull functions --- .../config/nvim/lua/fugitive_extensions.lua | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/symlinks/config/nvim/lua/fugitive_extensions.lua b/symlinks/config/nvim/lua/fugitive_extensions.lua index bb4f5eb..cab293d 100644 --- a/symlinks/config/nvim/lua/fugitive_extensions.lua +++ b/symlinks/config/nvim/lua/fugitive_extensions.lua @@ -2,18 +2,6 @@ -- - Fugitive.vim extensions library - ------------------------------------------------------------------------------- --- Shorcut to push directly to current branch on origin --- Similar to `ggpush` in fish config -local function push_origin() - vim.cmd('Git push origin ' .. vim.fn.FugitiveHead()) -end - --- Shorcut to pull directly from current branch on origin --- Similar to `ggpull` in fish config -local function pull_origin() - vim.cmd('Git pull origin ' .. vim.fn.FugitiveHead()) -end - -- Generates url for creating PR for current branch -- Tested only with github.com -- Works regardless of ssh or https for origin config @@ -51,6 +39,19 @@ end local M = {} +-- Shorcut to push directly to current branch on origin +-- Similar to `ggpush` in fish config +function M.push_origin() + vim.cmd('Git push origin ' .. vim.fn.FugitiveHead()) +end + +-- Shorcut to pull directly from current branch on origin +-- Similar to `ggpull` in fish config +function M.pull_origin() + vim.cmd('Git pull origin ' .. vim.fn.FugitiveHead()) +end + + -- Prints current branches PR url (not saved to :messages) -- Makes it easy to use terminal for opening url on click function M.print_pr_url(...)