Fix fugitive lua extensions push and pull functions

pull/1/head
Ensar Sarajčić 2021-03-08 10:46:42 +01:00
parent 5a80e0f22a
commit 9ba07e134d
1 changed files with 13 additions and 12 deletions

View File

@ -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(...)