From ce11e29b9a186a028048915b0629d4b6bf89a939 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 21 Aug 2024 08:59:55 -0400 Subject: [PATCH] Revert "devbox commit" This reverts commit 643e4181048244a1fd80d836e305ed1f7aaabf65. --- .../stdout-completions.zsh | 447 ++++++++++++++++++ devbox.json | 10 +- devbox.lock | 48 -- zsh/.zshrc | 5 +- 4 files changed, 456 insertions(+), 54 deletions(-) create mode 100644 chezmoi/dot_config/aux-zsh-completions/stdout-completions.zsh diff --git a/chezmoi/dot_config/aux-zsh-completions/stdout-completions.zsh b/chezmoi/dot_config/aux-zsh-completions/stdout-completions.zsh new file mode 100644 index 0000000..f109f33 --- /dev/null +++ b/chezmoi/dot_config/aux-zsh-completions/stdout-completions.zsh @@ -0,0 +1,447 @@ +#compdef starship + +autoload -U is-at-least + +_starship() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_starship_commands" \ +"*::: :->starship" \ +&& ret=0 + case $state in + (starship) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:starship-command-$line[1]:" + case $line[1] in + (bug-report) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(completions) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +':shell:(bash elvish fish powershell zsh)' \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +'::name -- Configuration key to edit:' \ +'::value -- Value to place into that key:' \ +&& ret=0 +;; +(explain) +_arguments "${_arguments_options[@]}" : \ +'-s+[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'--status=[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'*--pipestatus=[Bash, Fish and Zsh support returning codes for each process in a pipeline]:PIPESTATUS: ' \ +'-w+[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'--terminal-width=[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'-p+[The path that the prompt should render for]:PATH:_files' \ +'--path=[The path that the prompt should render for]:PATH:_files' \ +'-P+[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'--logical-path=[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'-d+[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'--cmd-duration=[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'-k+[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'--keymap=[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'-j+[The number of currently running jobs]:JOBS: ' \ +'--jobs=[The number of currently running jobs]:JOBS: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +'--print-full-init[]' \ +'-h[Print help]' \ +'--help[Print help]' \ +':shell:' \ +&& ret=0 +;; +(module) +_arguments "${_arguments_options[@]}" : \ +'-s+[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'--status=[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'*--pipestatus=[Bash, Fish and Zsh support returning codes for each process in a pipeline]:PIPESTATUS: ' \ +'-w+[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'--terminal-width=[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'-p+[The path that the prompt should render for]:PATH:_files' \ +'--path=[The path that the prompt should render for]:PATH:_files' \ +'-P+[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'--logical-path=[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'-d+[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'--cmd-duration=[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'-k+[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'--keymap=[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'-j+[The number of currently running jobs]:JOBS: ' \ +'--jobs=[The number of currently running jobs]:JOBS: ' \ +'-l[List out all supported modules]' \ +'--list[List out all supported modules]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'::name -- The name of the module to be printed:' \ +&& ret=0 +;; +(preset) +_arguments "${_arguments_options[@]}" : \ +'(-l --list)-o+[Output the preset to a file instead of stdout]:OUTPUT:_files' \ +'(-l --list)--output=[Output the preset to a file instead of stdout]:OUTPUT:_files' \ +'-l[List out all preset names]' \ +'--list[List out all preset names]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'::name -- The name of preset to be printed:(bracketed-segments gruvbox-rainbow jetpack nerd-font-symbols no-empty-icons no-nerd-font no-runtime-versions pastel-powerline plain-text-symbols pure-preset tokyo-night)' \ +&& ret=0 +;; +(print-config) +_arguments "${_arguments_options[@]}" : \ +'-d[Print the default instead of the computed config]' \ +'--default[Print the default instead of the computed config]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::name -- Configuration keys to print:' \ +&& ret=0 +;; +(prompt) +_arguments "${_arguments_options[@]}" : \ +'(--right)--profile=[Print the prompt with the specified profile name (instead of the standard left prompt)]:PROFILE: ' \ +'-s+[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'--status=[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'*--pipestatus=[Bash, Fish and Zsh support returning codes for each process in a pipeline]:PIPESTATUS: ' \ +'-w+[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'--terminal-width=[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'-p+[The path that the prompt should render for]:PATH:_files' \ +'--path=[The path that the prompt should render for]:PATH:_files' \ +'-P+[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'--logical-path=[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'-d+[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'--cmd-duration=[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'-k+[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'--keymap=[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'-j+[The number of currently running jobs]:JOBS: ' \ +'--jobs=[The number of currently running jobs]:JOBS: ' \ +'--right[Print the right prompt (instead of the standard left prompt)]' \ +'(--right --profile)--continuation[Print the continuation prompt (instead of the standard left prompt)]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(session) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(time) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(timings) +_arguments "${_arguments_options[@]}" : \ +'-s+[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'--status=[The status code of the previously run command as an unsigned or signed 32bit integer]:STATUS_CODE: ' \ +'*--pipestatus=[Bash, Fish and Zsh support returning codes for each process in a pipeline]:PIPESTATUS: ' \ +'-w+[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'--terminal-width=[The width of the current interactive terminal]:TERMINAL_WIDTH: ' \ +'-p+[The path that the prompt should render for]:PATH:_files' \ +'--path=[The path that the prompt should render for]:PATH:_files' \ +'-P+[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'--logical-path=[The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument]:LOGICAL_PATH:_files' \ +'-d+[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'--cmd-duration=[The execution duration of the last command, in milliseconds]:CMD_DURATION: ' \ +'-k+[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'--keymap=[The keymap of fish/zsh/cmd]:KEYMAP: ' \ +'-j+[The number of currently running jobs]:JOBS: ' \ +'--jobs=[The number of currently running jobs]:JOBS: ' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(toggle) +_arguments "${_arguments_options[@]}" : \ +'-h[Print help]' \ +'--help[Print help]' \ +':name -- The name of the module to be toggled:' \ +'::value -- The key of the config to be toggled:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_starship__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:starship-help-command-$line[1]:" + case $line[1] in + (bug-report) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(completions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(explain) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(init) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(module) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(preset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(print-config) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(prompt) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(session) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(time) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(timings) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(toggle) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_starship_commands] )) || +_starship_commands() { + local commands; commands=( +'bug-report:Create a pre-populated GitHub issue with information about your configuration' \ +'completions:Generate starship shell completions for your shell to stdout' \ +'config:Edit the starship configuration' \ +'explain:Explains the currently showing modules' \ +'init:Prints the shell function used to execute starship' \ +'module:Prints a specific prompt module' \ +'preset:Prints a preset config' \ +'print-config:Prints the computed starship configuration' \ +'prompt:Prints the full starship prompt' \ +'session:Generate random session key' \ +'time:Prints time in milliseconds' \ +'timings:Prints timings of all active modules' \ +'toggle:Toggle a given starship module' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'starship commands' commands "$@" +} +(( $+functions[_starship__bug-report_commands] )) || +_starship__bug-report_commands() { + local commands; commands=() + _describe -t commands 'starship bug-report commands' commands "$@" +} +(( $+functions[_starship__completions_commands] )) || +_starship__completions_commands() { + local commands; commands=() + _describe -t commands 'starship completions commands' commands "$@" +} +(( $+functions[_starship__config_commands] )) || +_starship__config_commands() { + local commands; commands=() + _describe -t commands 'starship config commands' commands "$@" +} +(( $+functions[_starship__explain_commands] )) || +_starship__explain_commands() { + local commands; commands=() + _describe -t commands 'starship explain commands' commands "$@" +} +(( $+functions[_starship__help_commands] )) || +_starship__help_commands() { + local commands; commands=( +'bug-report:Create a pre-populated GitHub issue with information about your configuration' \ +'completions:Generate starship shell completions for your shell to stdout' \ +'config:Edit the starship configuration' \ +'explain:Explains the currently showing modules' \ +'init:Prints the shell function used to execute starship' \ +'module:Prints a specific prompt module' \ +'preset:Prints a preset config' \ +'print-config:Prints the computed starship configuration' \ +'prompt:Prints the full starship prompt' \ +'session:Generate random session key' \ +'time:Prints time in milliseconds' \ +'timings:Prints timings of all active modules' \ +'toggle:Toggle a given starship module' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'starship help commands' commands "$@" +} +(( $+functions[_starship__help__bug-report_commands] )) || +_starship__help__bug-report_commands() { + local commands; commands=() + _describe -t commands 'starship help bug-report commands' commands "$@" +} +(( $+functions[_starship__help__completions_commands] )) || +_starship__help__completions_commands() { + local commands; commands=() + _describe -t commands 'starship help completions commands' commands "$@" +} +(( $+functions[_starship__help__config_commands] )) || +_starship__help__config_commands() { + local commands; commands=() + _describe -t commands 'starship help config commands' commands "$@" +} +(( $+functions[_starship__help__explain_commands] )) || +_starship__help__explain_commands() { + local commands; commands=() + _describe -t commands 'starship help explain commands' commands "$@" +} +(( $+functions[_starship__help__help_commands] )) || +_starship__help__help_commands() { + local commands; commands=() + _describe -t commands 'starship help help commands' commands "$@" +} +(( $+functions[_starship__help__init_commands] )) || +_starship__help__init_commands() { + local commands; commands=() + _describe -t commands 'starship help init commands' commands "$@" +} +(( $+functions[_starship__help__module_commands] )) || +_starship__help__module_commands() { + local commands; commands=() + _describe -t commands 'starship help module commands' commands "$@" +} +(( $+functions[_starship__help__preset_commands] )) || +_starship__help__preset_commands() { + local commands; commands=() + _describe -t commands 'starship help preset commands' commands "$@" +} +(( $+functions[_starship__help__print-config_commands] )) || +_starship__help__print-config_commands() { + local commands; commands=() + _describe -t commands 'starship help print-config commands' commands "$@" +} +(( $+functions[_starship__help__prompt_commands] )) || +_starship__help__prompt_commands() { + local commands; commands=() + _describe -t commands 'starship help prompt commands' commands "$@" +} +(( $+functions[_starship__help__session_commands] )) || +_starship__help__session_commands() { + local commands; commands=() + _describe -t commands 'starship help session commands' commands "$@" +} +(( $+functions[_starship__help__time_commands] )) || +_starship__help__time_commands() { + local commands; commands=() + _describe -t commands 'starship help time commands' commands "$@" +} +(( $+functions[_starship__help__timings_commands] )) || +_starship__help__timings_commands() { + local commands; commands=() + _describe -t commands 'starship help timings commands' commands "$@" +} +(( $+functions[_starship__help__toggle_commands] )) || +_starship__help__toggle_commands() { + local commands; commands=() + _describe -t commands 'starship help toggle commands' commands "$@" +} +(( $+functions[_starship__init_commands] )) || +_starship__init_commands() { + local commands; commands=() + _describe -t commands 'starship init commands' commands "$@" +} +(( $+functions[_starship__module_commands] )) || +_starship__module_commands() { + local commands; commands=() + _describe -t commands 'starship module commands' commands "$@" +} +(( $+functions[_starship__preset_commands] )) || +_starship__preset_commands() { + local commands; commands=() + _describe -t commands 'starship preset commands' commands "$@" +} +(( $+functions[_starship__print-config_commands] )) || +_starship__print-config_commands() { + local commands; commands=() + _describe -t commands 'starship print-config commands' commands "$@" +} +(( $+functions[_starship__prompt_commands] )) || +_starship__prompt_commands() { + local commands; commands=() + _describe -t commands 'starship prompt commands' commands "$@" +} +(( $+functions[_starship__session_commands] )) || +_starship__session_commands() { + local commands; commands=() + _describe -t commands 'starship session commands' commands "$@" +} +(( $+functions[_starship__time_commands] )) || +_starship__time_commands() { + local commands; commands=() + _describe -t commands 'starship time commands' commands "$@" +} +(( $+functions[_starship__timings_commands] )) || +_starship__timings_commands() { + local commands; commands=() + _describe -t commands 'starship timings commands' commands "$@" +} +(( $+functions[_starship__toggle_commands] )) || +_starship__toggle_commands() { + local commands; commands=() + _describe -t commands 'starship toggle commands' commands "$@" +} + +if [ "$funcstack[1]" = "_starship" ]; then + _starship "$@" +else + compdef _starship starship +fi diff --git a/devbox.json b/devbox.json index 7274152..c00b8ff 100644 --- a/devbox.json +++ b/devbox.json @@ -14,7 +14,7 @@ "direnv@latest", "duf@latest", "eza@latest", - "fd@latest", + "fd@latest", "ffmpeg@latest", "fzf@latest", "gh@latest", @@ -53,11 +53,11 @@ "yq@latest", "zoxide@latest", "python@latest", - "ollama@latest" + "wl-clipboard@latest" ], "env": { "DEVBOX_GLOBAL_PREFIX": "$HOME/.local/share/devbox/global/default/.devbox/nix/profile/default", - "DEVBOX_GLOBAL_ROOT": "$HOME/.local/share/devbox/global/current" + "DEVBOX_GLOBAL_ROOT": "$HOME/.local/share/devbox/global/current" }, "shell": { "init_hook": [ @@ -78,7 +78,7 @@ "latest-hash": [ "curl -fsSL https://nixos.org/channels/nixos-unstable/git-revision" ] - }, - "nixpkgs": {} + }, + "nixpkgs": {} } } diff --git a/devbox.lock b/devbox.lock index 689ba26..7b338f4 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1394,54 +1394,6 @@ } } }, - "ollama@latest": { - "last_modified": "2024-08-14T11:41:26Z", - "resolved": "github:NixOS/nixpkgs/0cb2fd7c59fed0cd82ef858cbcbdb552b9a33465#ollama", - "source": "devbox-search", - "version": "0.3.5", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/9v27wavfppd684ppv1mnigasxxiza756-ollama-0.3.5", - "default": true - } - ], - "store_path": "/nix/store/9v27wavfppd684ppv1mnigasxxiza756-ollama-0.3.5" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/3ww2nbsf61ag7pw71dnqbqvk637c9qdf-ollama-0.3.5", - "default": true - } - ], - "store_path": "/nix/store/3ww2nbsf61ag7pw71dnqbqvk637c9qdf-ollama-0.3.5" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/xba2lc1nv0v0nv4lxmgil0pdswzr5d4l-ollama-0.3.5", - "default": true - } - ], - "store_path": "/nix/store/xba2lc1nv0v0nv4lxmgil0pdswzr5d4l-ollama-0.3.5" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/sm5yn3dmv5wm940xszfhy2w0i7hfbv77-ollama-0.3.5", - "default": true - } - ], - "store_path": "/nix/store/sm5yn3dmv5wm940xszfhy2w0i7hfbv77-ollama-0.3.5" - } - } - }, "p7zip@latest": { "last_modified": "2024-07-05T12:16:31Z", "resolved": "github:NixOS/nixpkgs/4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb#p7zip", diff --git a/zsh/.zshrc b/zsh/.zshrc index f78b66f..ffd020d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -99,7 +99,10 @@ zinit load denilsonsa/prettyping zinit ice as"completion" zinit snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker - +# aux completions +if ! grep -q "source ~/.config/aux-zsh-completions/stdout-completions.zsh" ~/.zshrc; then + echo "source ~/.config/aux-zsh-completions/stdout-completions.zsh" >> ~/.zshrc +fi ## zsh-bash-completions-fallback zinit ice depth=1 # optional, but avoids downloading the full history