Skip to content

Make git commands available to all sources #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cseickel opened this issue Sep 18, 2022 · 0 comments
Closed

Make git commands available to all sources #529

cseickel opened this issue Sep 18, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@cseickel
Copy link
Contributor

In the bottom window in this screenshot you can see that /scripts/init.sh isn't tracked by git:

Capture d’écran du 2022-09-18 13-00-53

I would like to execute git add scripts/init.sh via Neo-tree window.

When I press ? in Neo-tree window, I see that:

Capture d’écran du 2022-09-18 13-04-43

I see nothing to perform a git add... command.

From this documentation, I tried to add this lines in my Neo-tree setup config:

                window = {
                    mappings = {
                        ["<space>"] = {
                            "toggle_node",
                            nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
                        }--,
                        ["A"]  = "git_add_all",
                        ["gu"] = "git_unstage_file",
                        ["ga"] = "git_add_file",
                        ["gr"] = "git_revert_file",
                        ["gc"] = "git_commit",
                        ["gp"] = "git_push",
                        ["gg"] = "git_commit_and_push"
                    }
                },
Click to see complete Neo-tree config
    use {
        "nvim-neo-tree/neo-tree.nvim",
        branch = "v2.x",
        config = function ()
            -- Unless you are still migrating, remove the deprecated commands from v1.x
            vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
            require("neo-tree").setup({
                close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
                open_files_in_last_window = false,
                popup_border_style = "rounded",
                enable_git_status = true,
                enable_diagnostics = true,
                window = {
                    mappings = {
                        ["<space>"] = {
                            "toggle_node",
                            nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
                        }--,
                        ["A"]  = "git_add_all",
                        ["gu"] = "git_unstage_file",
                        ["ga"] = "git_add_file",
                        ["gr"] = "git_revert_file",
                        ["gc"] = "git_commit",
                        ["gp"] = "git_push",
                        ["gg"] = "git_commit_and_push"
                    }
                },
                filesystem = {
                    hijack_netrw_behavior = "open_current"
                }
            })
        end
    }

But that doesn't work. I have an error when I press ? in Neo-tree window.

Question: how do you execute "git add ..." from Neo-tree filesystem window view?

Best regards,
Stéphane

Originally posted by @stephane-klein in #528

@cseickel cseickel added the enhancement New feature or request label Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant