How does one do a quick add to stage? I dont want the popup to open #1076
Replies: 5 comments 3 replies
-
Staging/Unstage are both bound to the status buffer, so there's not a "public" way to do it, but if you want, you could dive into the internal call: So, something like |
Beta Was this translation helpful? Give feedback.
-
sadness... :(
…On Thu, Dec 28, 2023 at 3:36 PM Cameron ***@***.***> wrote:
Staging/Unstage are both bound to the status buffer, so there's not a
"public" way to do it, but if you want, you could dive into the internal
call:
https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/lib/git/index.lua#L104-L106
So, something like require('neogit.lib.git.index').add({ "<filepath>" })
would work. But, the core workflow of Neogit is via the status buffer, so..
I don't think I'd add direct commands for those actions
—
Reply to this email directly, view it on GitHub
<#1076 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAO4XUTYNMO6ZWXE4QPYCTTYLXJ33AVCNFSM6AAAAABBFWMZDOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSNRXHE2DC>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
… On Thu, Dec 28, 2023 at 3:50 PM G P ***@***.***> wrote:
sadness... :(
On Thu, Dec 28, 2023 at 3:36 PM Cameron ***@***.***> wrote:
> Staging/Unstage are both bound to the status buffer, so there's not a
> "public" way to do it, but if you want, you could dive into the internal
> call:
>
> https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/lib/git/index.lua#L104-L106
>
> So, something like require('neogit.lib.git.index').add({ "<filepath>" })
> would work. But, the core workflow of Neogit is via the status buffer, so..
> I don't think I'd add direct commands for those actions
>
> —
> Reply to this email directly, view it on GitHub
> <#1076 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAO4XUTYNMO6ZWXE4QPYCTTYLXJ33AVCNFSM6AAAAABBFWMZDOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSNRXHE2DC>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
This is super basic and will not show errors so definitely room for improvement, but I use this which just runs the git command, no Neogit involved. vim.keymap.set("n", "<leader>gw", function()
-- TODO: Add error checking/reporting, check vim.v.shell_error?
vim.cmd "silent !git add %:p"
end, { desc = "Git stage current buffer" }) |
Beta Was this translation helpful? Give feedback.
-
This is possible (easily) via gitsigns.nvim |
Beta Was this translation helpful? Give feedback.
-
I just want to quickly add a file to stage
currently i do NeogitStatus command and basically it opens the git status
Beta Was this translation helpful? Give feedback.
All reactions