Skip to content
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

some ideas from nu_scripts #7

Open
amtoine opened this issue Apr 30, 2023 · 2 comments
Open

some ideas from nu_scripts #7

amtoine opened this issue Apr 30, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed needs-triage The issues hasn't been triaged yet

Comments

@amtoine
Copy link
Owner

amtoine commented Apr 30, 2023

in the nushell/nu_scripts repo, we have the following files that could be interesting at some point

╭───┬───────────────────────────────────────────────────────────╮
│ 0 │ aliases/git/nu_alias_git.nu                               │
│ 1 │ custom-completions/auto-generate/completions/git-sizer.nu │
│ 2 │ custom-completions/auto-generate/completions/git.nu       │
│ 3 │ custom-completions/auto-generate/completions/gitk.nu      │
│ 4 │ modules/git/git.nu                                        │
│ 5 │ modules/git/git_branch_cleanup.nu                         │
│ 6 │ modules/prompt/async_git_prompt/async-git-prompt.nu       │
│ 7 │ modules/prompt/panache-git.nu                             │
│ 8 │ modules/prompt/powerline/power_git.nu                     │
│ 9 │ sourced/cool-oneliners/git_gone.nu                        │
╰───┴───────────────────────────────────────────────────────────╯

Note
generated with fd git | lines | find --invert themes before_v0.60 github gitlab custom-completions/git | find --invert --regex '/$'

there are also a bunch of things scattered around in my nu_scripts 👍
especially

@amtoine
Copy link
Owner Author

amtoine commented May 1, 2023

e.g. this command which might need to be reworked if the enter command gets removed from nushhell 👍

def list-repos [] {
    ghq list
    | lines
    | str replace $"($env.GIT_REPOS_HOME)/" ""
    | str replace "/.git$" ""
    | sort --ignore-case
}

export def-env "repo enter" [] {
    let choice = (
        list-repos
        | to text
        | fzf --ansi --prompt "Please choose a repo to enter: "
        | str trim
    )

    if ($choice | is-empty) {
        print "user choose to exit..."
        return
    }

    enter ($env.GIT_REPOS_HOME | path join $choice)

    print "Opened shells:"
    shells
}

amtoine added a commit to goatfiles/nu_scripts that referenced this issue May 1, 2023
@amtoine
Copy link
Owner Author

amtoine commented May 4, 2023

from the discord server

def get-commit-file [] {
    git rev-parse --show-toplevel
    | str trim
    | path join ".git" "gcf-commit-msg.txt"

}

export def gcf [] {
    let file = (get-commit-file)

    git commit -F $file
    "" | save -f $file
}

export def gcfe [] {
    ^$env.EDITOR (get-commit-file)
}

@amtoine amtoine added enhancement New feature or request help wanted Extra attention is needed labels May 8, 2023
@amtoine amtoine pinned this issue May 8, 2023
@amtoine amtoine added the needs-triage The issues hasn't been triaged yet label Nov 2, 2023
@amtoine amtoine unpinned this issue Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs-triage The issues hasn't been triaged yet
Projects
None yet
Development

No branches or pull requests

1 participant