···11-# Nushell Config File
22-33-module completions {
44- # Custom completions for external commands (those outside of Nushell)
55- # Each completions has two parts: the form of the external command, including its flags and parameters
66- # and a helper command that knows how to complete values for those flags and parameters
77- #
88- # This is a simplified version of completions for git branches and git remotes
99- def "nu-complete git branches" [] {
1010- ^git branch | lines | each { |line| $line | str replace '[\*\+] ' '' | str trim }
1111- }
1212-1313- def "nu-complete git remotes" [] {
1414- ^git remote | lines | each { |line| $line | str trim }
1515- }
1616-1717- export extern "git checkout" [
1818- branch?: string@"nu-complete git branches" # name of the branch to checkout
1919- -b: string # create and checkout a new branch
2020- -B: string # create/reset and checkout a branch
2121- -l # create reflog for new branch
2222- --guess # second guess 'git checkout <no-such-branch>' (default)
2323- --overlay # use overlay mode (default)
2424- --quiet(-q) # suppress progress reporting
2525- --recurse-submodules: string # control recursive updating of submodules
2626- --progress # force progress reporting
2727- --merge(-m) # perform a 3-way merge with the new branch
2828- --conflict: string # conflict style (merge or diff3)
2929- --detach(-d) # detach HEAD at named commit
3030- --track(-t) # set upstream info for new branch
3131- --force(-f) # force checkout (throw away local modifications)
3232- --orphan: string # new unparented branch
3333- --overwrite-ignore # update ignored files (default)
3434- --ignore-other-worktrees # do not check if another worktree is holding the given ref
3535- --ours(-2) # checkout our version for unmerged files
3636- --theirs(-3) # checkout their version for unmerged files
3737- --patch(-p) # select hunks interactively
3838- --ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only
3939- --pathspec-from-file: string # read pathspec from file
4040- ]
4141-4242- export extern "git push" [
4343- remote?: string@"nu-complete git remotes", # the name of the remote
4444- refspec?: string@"nu-complete git branches"# the branch / refspec
4545- --verbose(-v) # be more verbose
4646- --quiet(-q) # be more quiet
4747- --repo: string # repository
4848- --all # push all refs
4949- --mirror # mirror all refs
5050- --delete(-d) # delete refs
5151- --tags # push tags (can't be used with --all or --mirror)
5252- --dry-run(-n) # dry run
5353- --porcelain # machine-readable output
5454- --force(-f) # force updates
5555- --force-with-lease: string # require old value of ref to be at this value
5656- --recurse-submodules: string # control recursive pushing of submodules
5757- --thin # use thin pack
5858- --receive-pack: string # receive pack program
5959- --exec: string # receive pack program
6060- --set-upstream(-u) # set upstream for git pull/status
6161- --progress # force progress reporting
6262- --prune # prune locally removed refs
6363- --no-verify # bypass pre-push hook
6464- --follow-tags # push missing but relevant tags
6565- --signed: string # GPG sign the push
6666- --atomic # request atomic transaction on remote side
6767- --push-option(-o): string # option to transmit
6868- --ipv4(-4) # use IPv4 addresses only
6969- --ipv6(-6) # use IPv6 addresses only
7070- ]
7171-}
7272-7373-# Get just the extern definitions without the custom completion commands
7474-use completions *
7575-7676-7777-# Custom settings
7878-let-env config = {
7979- rm_always_trash: true,
8080- edit_mode: vi,
8181- max_history_size: 100000,
8282- footer_mode: auto,
8383- history_file_format: "sqlite",
8484-}
8585-8686-### Setup aliases
8787-alias edit = ^($env.EDITOR)
8888-alias start = ^open
8989-alias less = bat
9090-alias set-light-theme = kitty +kitten themes Breakers
9191-alias set-dark-theme = kitty +kitten themes Mariana
9292-alias brew-backup = brew bundle dump --global --no-lock --cask --mas --tap --force
9393-alias brew-cleanup = brew bundle cleanup --global --no-lock --force --zap
9494-alias brew-restore = brew bundle install --global --no-lock
9595-alias packer-sync = nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"
9696-9797-# Load autojump plugin "zoxide"
9898-source ~/.cache/zoxide/zoxide.nu