File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1
1
vim .keymap .set (" n" , " <leader>gs" , vim .cmd .Git );
2
2
3
+ local ThePrimeagen_Fugitive = vim .api .nvim_create_augroup (" ThePrimeagen_Fugitive" , {})
4
+
5
+ local autocmd = vim .api .nvim_create_autocmd
6
+ autocmd (" BufWinEnter" , {
7
+ group = ThePrimeagen_Fugitive ,
8
+ pattern = " *" ,
9
+ callback = function ()
10
+ print (" help" , vim .bo .ft )
11
+ if vim .bo .ft ~= " fugitive" then
12
+ return
13
+ end
14
+
15
+ local bufnr = vim .api .nvim_get_current_buf ()
16
+ local opts = {buffer = bufnr , remap = false }
17
+ print (" great success" , vim .bo .ft , bufnr , vim .inspect (opts ))
18
+ vim .keymap .set (" n" , " <leader>p" , function ()
19
+ vim .cmd [[ Git push ]]
20
+ end , opts )
21
+
22
+ -- rebase always
23
+ vim .keymap .set (" n" , " <leader>P" , function ()
24
+ vim .cmd [[ Git pull --rebase ]]
25
+ end , opts )
26
+
27
+ -- NOTE: It allows me to easily set the branch i am pushing and any tracking
28
+ -- needed if i did not set the branch up correctly
29
+ vim .keymap .set (" n" , " <leader>t" , " :Git push -u origin " , opts );
30
+ end ,
31
+ })
You can’t perform that action at this time.
0 commit comments