add Gcm command
This commit is contained in:
@@ -3,6 +3,8 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
vim.keymap.set('n', "<leader>gs", vim.cmd.Git)
|
vim.keymap.set('n', "<leader>gs", vim.cmd.Git)
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command('Gcm', function() vim.cmd.Git({ 'switch main' }) end, {})
|
||||||
|
|
||||||
local Crentist_Fugitive = vim.api.nvim_create_augroup('Crentist_Fugitive', {})
|
local Crentist_Fugitive = vim.api.nvim_create_augroup('Crentist_Fugitive', {})
|
||||||
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
@@ -14,15 +16,15 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local SwitchToMainbufnr = vim.api.nvim_get_current_buf()
|
||||||
local opts = {buffer = bufnr, remap = false}
|
local opts = { buffer = bufnr, remap = false }
|
||||||
vim.keymap.set('n', "<leader>p", function()
|
vim.keymap.set('n', "<leader>p", function()
|
||||||
vim.cmd.Git('push')
|
vim.cmd.Git('push')
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
-- rebase always
|
-- rebase always
|
||||||
vim.keymap.set('n', "<leader>P", function()
|
vim.keymap.set('n', "<leader>P", function()
|
||||||
vim.cmd.Git({'pull', '--rebase'})
|
vim.cmd.Git({ 'pull', '--rebase' })
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
|
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
|
||||||
|
|||||||
Reference in New Issue
Block a user