From f695029b5f7faad2de19b55fa69e7a526ee4ad5a Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 25 Jun 2024 22:48:48 +0200 Subject: [PATCH 01/11] aliases and EDITOR (once more) --- .zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.zshrc b/.zshrc index ecdcaa6..2fa6692 100644 --- a/.zshrc +++ b/.zshrc @@ -11,6 +11,8 @@ export CLIPBOARD_NOGUI=0 # wayland only allows GUI apps to use the clipboard. # For wayland, set this to `1` # see https://github.com/Slackadays/Clipboard/issues/171 export DATEFMT='+%a %Y-%m-%d %X' +export EDITOR=nvim +export VISUAL=nvim ### Aliases @@ -39,6 +41,7 @@ alias open=xdg-open alias ipb="ip -brief" alias psa="ps -eadf" alias fsize="stat --printf='%s'" +alias rg="rg --no-ignore" ### Functions function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" } From 2ecd846ad62c86a9496022168d3f43177c711d0f Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 4 Jul 2024 19:55:33 +0200 Subject: [PATCH 02/11] nvm shit and home alias --- .zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.zshrc b/.zshrc index 2fa6692..32d155b 100644 --- a/.zshrc +++ b/.zshrc @@ -42,6 +42,7 @@ alias ipb="ip -brief" alias psa="ps -eadf" alias fsize="stat --printf='%s'" alias rg="rg --no-ignore" +alias home="cd $HOME" ### Functions function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" } @@ -218,3 +219,7 @@ if [ -d $HOME/.pyenv ]; then eval "$(pyenv virtualenv-init - zsh)" pyenv activate std 2> /dev/null > /dev/null fi + +export NVM_DIR="$HOME/.config/nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion From 7d4e26125444f62bffec7aa90acadb2de05618ba Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 4 Jul 2024 19:55:36 +0200 Subject: [PATCH 03/11] sync nvim --- .config/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim b/.config/nvim index 10f2d2c..ac2ac08 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 10f2d2c76eae57ba6d6f805d9c6a0a1f1c9eed4f +Subproject commit ac2ac080c9c4ab7e4c1f75268f603b8455679bb2 From 34a61fe1f9463496c7d79ca54a78107803da41a1 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 5 Jul 2024 22:32:13 +0200 Subject: [PATCH 04/11] fuck nvm --- .zshrc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.zshrc b/.zshrc index 32d155b..94cb140 100644 --- a/.zshrc +++ b/.zshrc @@ -33,7 +33,6 @@ alias datefmt='date $DATEFMT' alias gg=lazygit alias reload="source ~/.zshrc" alias gls=/bin/ls -alias neorg='nvim -c "Neorg workspace $1"' alias bat=batcat alias accon="HOST=$(hostname) conda activate" alias gotemp="cd $(mktemp -d)" @@ -87,6 +86,14 @@ setopt hist_ignore_dups # ignore duplicated commands history list setopt hist_ignore_space # ignore commands that start with space setopt hist_verify # show command with history expansion to user before running it +### load unversioned zsh code +if [ -f ~/.zsh.local ]; then + source ~/.zsh.local +else + touch ~/.zsh.local +fi + + ### --- Inputs Config ------------------------------------ # vim keys, then override stuff. bindkey -v @@ -178,10 +185,6 @@ fpath=($ZSH/plugins/zsh-completions/src $fpath) export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'" export FZF_CTRL_R_OPTS='--no-sort --exact' -### --- nnn Config ------------------------------------ -source ~/.local/share/nnn/quitcd/quitcd.bash_zsh -export NNN_PLUG='j:jump;z:autojump;' - ### --- kitty Config ------------------------------------ # $KITTY_TERM is a custom envar I set in the kitty conf # this stuff does not work nicely with tmux, just make them regular aliases. Shows an error if you use them in another terminal @@ -204,13 +207,6 @@ else eval "$(zoxide init zsh)" fi -### load unversioned zsh code -if [ -f ~/.zsh.local ]; then - source ~/.zsh.local -else - touch ~/.zsh.local -fi - ### --- pyenv Config ------------------------------------- if [ -d $HOME/.pyenv ]; then export PYENV_ROOT="$HOME/.pyenv" @@ -219,7 +215,3 @@ if [ -d $HOME/.pyenv ]; then eval "$(pyenv virtualenv-init - zsh)" pyenv activate std 2> /dev/null > /dev/null fi - -export NVM_DIR="$HOME/.config/nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion From 9d19d81a6fb10dacf15172d32c61d1f480ea760e Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 15 Jul 2024 11:26:00 +0200 Subject: [PATCH 05/11] zsh-autoquoter --- .gitmodules | 3 +++ .zsh/plugins/zsh-autoquoter | 1 + .zshrc | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 160000 .zsh/plugins/zsh-autoquoter diff --git a/.gitmodules b/.gitmodules index 2865e56..a7568cf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "nvchad-custom"] path = .custon/nvim/lua/custom url = https://git.cscherr.de/PlexSheep/nvchad-custom +[submodule ".zsh/plugins/zsh-autoquoter"] + path = .zsh/plugins/zsh-autoquoter + url = https://github.com/ianthehenry/zsh-autoquoter diff --git a/.zsh/plugins/zsh-autoquoter b/.zsh/plugins/zsh-autoquoter new file mode 160000 index 0000000..9e3b1b2 --- /dev/null +++ b/.zsh/plugins/zsh-autoquoter @@ -0,0 +1 @@ +Subproject commit 9e3b1b216bf7b61a9807a242bae730b5fc232a44 diff --git a/.zshrc b/.zshrc index 94cb140..a91551b 100644 --- a/.zshrc +++ b/.zshrc @@ -58,7 +58,10 @@ function condac() { conda activate $@ export HOST=$(hostname) } -# TODO: make neorg a function, take a workspace as arg +# calculate on shell with `c 1+1` +function c() { printf "%s\n" "$@" | bc -l; } +# call python in a print from args +function py() { python -c "from math import *; print($*)" } ### ---- zsh options ------------------------------------- setopt autocd @@ -177,10 +180,15 @@ fi ### ---- PLUGINS ----------------------------------- source $ZSH/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh source $ZSH/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source $ZSH/plugins/zsh-autoquoter/zsh-autoquoter.zsh +ZSH_HIGHLIGHT_HIGHLIGHTERS+=(zaq) source ~/.local/share/fzf/key-bindings.zsh source ~/.local/share/fzf/completion.zsh fpath=($ZSH/plugins/zsh-completions/src $fpath) +ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m') +ZAQ_PREFIXES_GREEDY+=('py #') + ### --- fzf Config ------------------------------------ export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'" export FZF_CTRL_R_OPTS='--no-sort --exact' From 8dd89735efc439a31b917b562b15a7bd07469733 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 15 Jul 2024 11:27:58 +0200 Subject: [PATCH 06/11] sync nvim --- .config/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim b/.config/nvim index ac2ac08..2a6fb44 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit ac2ac080c9c4ab7e4c1f75268f603b8455679bb2 +Subproject commit 2a6fb440abc22a21d20fb3e4166f414ec43f495a From b737c6a9cb1dcfb062e4eb6d07f3371d477a4efd Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 26 Jul 2024 17:51:12 +0200 Subject: [PATCH 07/11] moar zfunc --- .zsh/zfunc/.zfunc/_nala | 7 + .zsh/zfunc/.zfunc/_rustup | 786 ++++++++++++++++++++++++++++++++++++++ .zsh/zfunc/_diesel | 692 +++++++++++++++++++++++++++++++++ 3 files changed, 1485 insertions(+) create mode 100644 .zsh/zfunc/.zfunc/_nala create mode 100644 .zsh/zfunc/.zfunc/_rustup create mode 100644 .zsh/zfunc/_diesel diff --git a/.zsh/zfunc/.zfunc/_nala b/.zsh/zfunc/.zfunc/_nala new file mode 100644 index 0000000..4aef6db --- /dev/null +++ b/.zsh/zfunc/.zfunc/_nala @@ -0,0 +1,7 @@ +#compdef nala + +_nala_completion() { + eval $(env _TYPER_COMPLETE_ARGS="${words[1,$CURRENT]}" _NALA_COMPLETE=complete_zsh nala) +} + +compdef _nala_completion nala \ No newline at end of file diff --git a/.zsh/zfunc/.zfunc/_rustup b/.zsh/zfunc/.zfunc/_rustup new file mode 100644 index 0000000..6c91ed2 --- /dev/null +++ b/.zsh/zfunc/.zfunc/_rustup @@ -0,0 +1,786 @@ +#compdef rustup + +autoload -U is-at-least + +_rustup() { + 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 information]' \ +'--help[Print help information]' \ +'-V[Print version information]' \ +'--version[Print version information]' \ +'*-v[Enable verbose output]' \ +'*--verbose[Enable verbose output]' \ +'(-v --verbose)*-q[Disable progress output]' \ +'(-v --verbose)*--quiet[Disable progress output]' \ +'::+toolchain -- release channel (e.g. +stable) or custom toolchain to set override:' \ +":: :_rustup_commands" \ +"*::: :->rustup" \ +&& ret=0 + case $state in + (rustup) + words=($line[2] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-command-$line[2]:" + case $line[2] in + (dump-testament) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(show) +_arguments "${_arguments_options[@]}" \ +'*-v[Enable verbose output with rustc information for all installed toolchains]' \ +'*--verbose[Enable verbose output with rustc information for all installed toolchains]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__show_commands" \ +"*::: :->show" \ +&& ret=0 + + case $state in + (show) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-show-command-$line[1]:" + case $line[1] in + (active-toolchain) +_arguments "${_arguments_options[@]}" \ +'*-v[Enable verbose output with rustc information]' \ +'*--verbose[Enable verbose output with rustc information]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(home) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(profile) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(install) +_arguments "${_arguments_options[@]}" \ +'--profile=[]: :(minimal default complete)' \ +'*--no-self-update[Don'\''t perform self-update when running the `rustup install` command]' \ +'*--force[Force an update, even if some components are missing]' \ +'*--force-non-host[Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(uninstall) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(update) +_arguments "${_arguments_options[@]}" \ +'*--no-self-update[Don'\''t perform self update when running the `rustup update` command]' \ +'*--force[Force an update, even if some components are missing]' \ +'*--force-non-host[Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(check) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(default) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(toolchain) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__toolchain_commands" \ +"*::: :->toolchain" \ +&& ret=0 + + case $state in + (toolchain) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-toolchain-command-$line[1]:" + case $line[1] in + (list) +_arguments "${_arguments_options[@]}" \ +'*-v[Enable verbose output with toolchain information]' \ +'*--verbose[Enable verbose output with toolchain information]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(install) +_arguments "${_arguments_options[@]}" \ +'--profile=[]: :(minimal default complete)' \ +'*-c+[Add specific components on installation]: : ' \ +'*--component=[Add specific components on installation]: : ' \ +'*-t+[Add specific targets on installation]: : ' \ +'*--target=[Add specific targets on installation]: : ' \ +'*--no-self-update[Don'\''t perform self update when running the`rustup toolchain install` command]' \ +'*--force[Force an update, even if some components are missing]' \ +'*--allow-downgrade[Allow rustup to downgrade the toolchain to satisfy your component choice]' \ +'*--force-non-host[Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(uninstall) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(link) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':toolchain -- Custom toolchain name:' \ +':path -- Path to the directory:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(target) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__target_commands" \ +"*::: :->target" \ +&& ret=0 + + case $state in + (target) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-target-command-$line[1]:" + case $line[1] in + (list) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'*--installed[List only installed targets]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(add) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::target -- List of targets to install; "all" installs all available targets:' \ +&& ret=0 +;; +(remove) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::target -- List of targets to uninstall:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(component) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__component_commands" \ +"*::: :->component" \ +&& ret=0 + + case $state in + (component) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-component-command-$line[1]:" + case $line[1] in + (list) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'*--installed[List only installed components]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(add) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'--target=[]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::component:' \ +&& ret=0 +;; +(remove) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'--target=[]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'*::component:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(override) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__override_commands" \ +"*::: :->override" \ +&& ret=0 + + case $state in + (override) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-override-command-$line[1]:" + case $line[1] in + (list) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(set) +_arguments "${_arguments_options[@]}" \ +'--path=[Path to the directory]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +&& ret=0 +;; +(unset) +_arguments "${_arguments_options[@]}" \ +'--path=[Path to the directory]: : ' \ +'*--nonexistent[Remove override toolchain for all nonexistent directories]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(run) +_arguments "${_arguments_options[@]}" \ +'*--install[Install the requested toolchain if needed]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':toolchain -- Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`:' \ +'*::command:' \ +&& ret=0 +;; +(which) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':command:' \ +&& ret=0 +;; +(doc) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'*--path[Only print the path to the documentation]' \ +'*--alloc[The Rust core allocation and collections library]' \ +'*--book[The Rust Programming Language book]' \ +'*--cargo[The Cargo Book]' \ +'*--core[The Rust Core Library]' \ +'*--edition-guide[The Rust Edition Guide]' \ +'*--nomicon[The Dark Arts of Advanced and Unsafe Rust Programming]' \ +'*--proc_macro[A support library for macro authors when defining new macros]' \ +'*--reference[The Rust Reference]' \ +'*--rust-by-example[A collection of runnable examples that illustrate various Rust concepts and standard libraries]' \ +'*--rustc[The compiler for the Rust programming language]' \ +'*--rustdoc[Documentation generator for Rust projects]' \ +'*--std[Standard library API documentation]' \ +'*--test[Support code for rustc'\''s built in unit-test and micro-benchmarking framework]' \ +'*--unstable-book[The Unstable Book]' \ +'*--embedded-book[The Embedded Rust Book]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'::topic -- Topic such as '\''core'\'', '\''fn'\'', '\''usize'\'', '\''eprintln!'\'', '\''core\:\:arch'\'', '\''alloc\:\:format!'\'', '\''std\:\:fs'\'', '\''std\:\:fs\:\:read_dir'\'', '\''std\:\:io\:\:Bytes'\'', '\''std\:\:iter\:\:Sum'\'', '\''std\:\:io\:\:error\:\:Result'\'' etc...:' \ +&& ret=0 +;; +(man) +_arguments "${_arguments_options[@]}" \ +'--toolchain=[Toolchain name, such as '\''stable'\'', '\''nightly'\'', or '\''1.8.0'\''. For more information see `rustup help toolchain`]: : ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':command:' \ +&& ret=0 +;; +(self) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__self_commands" \ +"*::: :->self" \ +&& ret=0 + + case $state in + (self) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-self-command-$line[1]:" + case $line[1] in + (update) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(uninstall) +_arguments "${_arguments_options[@]}" \ +'*-y[]' \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(upgrade-data) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(set) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +":: :_rustup__set_commands" \ +"*::: :->set" \ +&& ret=0 + + case $state in + (set) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:rustup-set-command-$line[1]:" + case $line[1] in + (default-host) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':host_triple:' \ +&& ret=0 +;; +(profile) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':profile-name:(minimal default complete)' \ +&& ret=0 +;; +(auto-self-update) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +':auto-self-update-mode:(enable disable check-only)' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +;; +(completions) +_arguments "${_arguments_options[@]}" \ +'-h[Print help information]' \ +'--help[Print help information]' \ +'::shell:(bash elvish fish powershell zsh)' \ +'::command:(rustup cargo)' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +'*::subcommand -- The subcommand whose help message to display:' \ +&& ret=0 +;; + esac + ;; +esac +} + +(( $+functions[_rustup_commands] )) || +_rustup_commands() { + local commands; commands=( +'dump-testament:Dump information about the build' \ +'show:Show the active and installed toolchains or profiles' \ +'install:Update Rust toolchains' \ +'uninstall:Uninstall Rust toolchains' \ +'update:Update Rust toolchains and rustup' \ +'check:Check for updates to Rust toolchains and rustup' \ +'default:Set the default toolchain' \ +'toolchain:Modify or query the installed toolchains' \ +'target:Modify a toolchain'\''s supported targets' \ +'component:Modify a toolchain'\''s installed components' \ +'override:Modify directory toolchain overrides' \ +'run:Run a command with an environment configured for a given toolchain' \ +'which:Display which binary will be run for a given command' \ +'doc:Open the documentation for the current toolchain' \ +'man:View the man page for a given command' \ +'self:Modify the rustup installation' \ +'set:Alter rustup settings' \ +'completions:Generate tab-completion scripts for your shell' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup commands' commands "$@" +} +(( $+functions[_rustup__show__active-toolchain_commands] )) || +_rustup__show__active-toolchain_commands() { + local commands; commands=() + _describe -t commands 'rustup show active-toolchain commands' commands "$@" +} +(( $+functions[_rustup__component__add_commands] )) || +_rustup__component__add_commands() { + local commands; commands=() + _describe -t commands 'rustup component add commands' commands "$@" +} +(( $+functions[_rustup__target__add_commands] )) || +_rustup__target__add_commands() { + local commands; commands=() + _describe -t commands 'rustup target add commands' commands "$@" +} +(( $+functions[_rustup__set__auto-self-update_commands] )) || +_rustup__set__auto-self-update_commands() { + local commands; commands=() + _describe -t commands 'rustup set auto-self-update commands' commands "$@" +} +(( $+functions[_rustup__check_commands] )) || +_rustup__check_commands() { + local commands; commands=() + _describe -t commands 'rustup check commands' commands "$@" +} +(( $+functions[_rustup__completions_commands] )) || +_rustup__completions_commands() { + local commands; commands=() + _describe -t commands 'rustup completions commands' commands "$@" +} +(( $+functions[_rustup__component_commands] )) || +_rustup__component_commands() { + local commands; commands=( +'list:List installed and available components' \ +'add:Add a component to a Rust toolchain' \ +'remove:Remove a component from a Rust toolchain' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup component commands' commands "$@" +} +(( $+functions[_rustup__default_commands] )) || +_rustup__default_commands() { + local commands; commands=() + _describe -t commands 'rustup default commands' commands "$@" +} +(( $+functions[_rustup__set__default-host_commands] )) || +_rustup__set__default-host_commands() { + local commands; commands=() + _describe -t commands 'rustup set default-host commands' commands "$@" +} +(( $+functions[_rustup__doc_commands] )) || +_rustup__doc_commands() { + local commands; commands=() + _describe -t commands 'rustup doc commands' commands "$@" +} +(( $+functions[_rustup__dump-testament_commands] )) || +_rustup__dump-testament_commands() { + local commands; commands=() + _describe -t commands 'rustup dump-testament commands' commands "$@" +} +(( $+functions[_rustup__component__help_commands] )) || +_rustup__component__help_commands() { + local commands; commands=() + _describe -t commands 'rustup component help commands' commands "$@" +} +(( $+functions[_rustup__help_commands] )) || +_rustup__help_commands() { + local commands; commands=() + _describe -t commands 'rustup help commands' commands "$@" +} +(( $+functions[_rustup__override__help_commands] )) || +_rustup__override__help_commands() { + local commands; commands=() + _describe -t commands 'rustup override help commands' commands "$@" +} +(( $+functions[_rustup__self__help_commands] )) || +_rustup__self__help_commands() { + local commands; commands=() + _describe -t commands 'rustup self help commands' commands "$@" +} +(( $+functions[_rustup__set__help_commands] )) || +_rustup__set__help_commands() { + local commands; commands=() + _describe -t commands 'rustup set help commands' commands "$@" +} +(( $+functions[_rustup__show__help_commands] )) || +_rustup__show__help_commands() { + local commands; commands=() + _describe -t commands 'rustup show help commands' commands "$@" +} +(( $+functions[_rustup__target__help_commands] )) || +_rustup__target__help_commands() { + local commands; commands=() + _describe -t commands 'rustup target help commands' commands "$@" +} +(( $+functions[_rustup__toolchain__help_commands] )) || +_rustup__toolchain__help_commands() { + local commands; commands=() + _describe -t commands 'rustup toolchain help commands' commands "$@" +} +(( $+functions[_rustup__show__home_commands] )) || +_rustup__show__home_commands() { + local commands; commands=() + _describe -t commands 'rustup show home commands' commands "$@" +} +(( $+functions[_rustup__install_commands] )) || +_rustup__install_commands() { + local commands; commands=() + _describe -t commands 'rustup install commands' commands "$@" +} +(( $+functions[_rustup__toolchain__install_commands] )) || +_rustup__toolchain__install_commands() { + local commands; commands=() + _describe -t commands 'rustup toolchain install commands' commands "$@" +} +(( $+functions[_rustup__toolchain__link_commands] )) || +_rustup__toolchain__link_commands() { + local commands; commands=() + _describe -t commands 'rustup toolchain link commands' commands "$@" +} +(( $+functions[_rustup__component__list_commands] )) || +_rustup__component__list_commands() { + local commands; commands=() + _describe -t commands 'rustup component list commands' commands "$@" +} +(( $+functions[_rustup__override__list_commands] )) || +_rustup__override__list_commands() { + local commands; commands=() + _describe -t commands 'rustup override list commands' commands "$@" +} +(( $+functions[_rustup__target__list_commands] )) || +_rustup__target__list_commands() { + local commands; commands=() + _describe -t commands 'rustup target list commands' commands "$@" +} +(( $+functions[_rustup__toolchain__list_commands] )) || +_rustup__toolchain__list_commands() { + local commands; commands=() + _describe -t commands 'rustup toolchain list commands' commands "$@" +} +(( $+functions[_rustup__man_commands] )) || +_rustup__man_commands() { + local commands; commands=() + _describe -t commands 'rustup man commands' commands "$@" +} +(( $+functions[_rustup__override_commands] )) || +_rustup__override_commands() { + local commands; commands=( +'list:List directory toolchain overrides' \ +'set:Set the override toolchain for a directory' \ +'unset:Remove the override toolchain for a directory' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup override commands' commands "$@" +} +(( $+functions[_rustup__set__profile_commands] )) || +_rustup__set__profile_commands() { + local commands; commands=() + _describe -t commands 'rustup set profile commands' commands "$@" +} +(( $+functions[_rustup__show__profile_commands] )) || +_rustup__show__profile_commands() { + local commands; commands=() + _describe -t commands 'rustup show profile commands' commands "$@" +} +(( $+functions[_rustup__component__remove_commands] )) || +_rustup__component__remove_commands() { + local commands; commands=() + _describe -t commands 'rustup component remove commands' commands "$@" +} +(( $+functions[_rustup__target__remove_commands] )) || +_rustup__target__remove_commands() { + local commands; commands=() + _describe -t commands 'rustup target remove commands' commands "$@" +} +(( $+functions[_rustup__run_commands] )) || +_rustup__run_commands() { + local commands; commands=() + _describe -t commands 'rustup run commands' commands "$@" +} +(( $+functions[_rustup__self_commands] )) || +_rustup__self_commands() { + local commands; commands=( +'update:Download and install updates to rustup' \ +'uninstall:Uninstall rustup.' \ +'upgrade-data:Upgrade the internal data format.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup self commands' commands "$@" +} +(( $+functions[_rustup__override__set_commands] )) || +_rustup__override__set_commands() { + local commands; commands=() + _describe -t commands 'rustup override set commands' commands "$@" +} +(( $+functions[_rustup__set_commands] )) || +_rustup__set_commands() { + local commands; commands=( +'default-host:The triple used to identify toolchains when not specified' \ +'profile:The default components installed' \ +'auto-self-update:The rustup auto self update mode' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup set commands' commands "$@" +} +(( $+functions[_rustup__show_commands] )) || +_rustup__show_commands() { + local commands; commands=( +'active-toolchain:Show the active toolchain' \ +'home:Display the computed value of RUSTUP_HOME' \ +'profile:Show the current profile' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup show commands' commands "$@" +} +(( $+functions[_rustup__target_commands] )) || +_rustup__target_commands() { + local commands; commands=( +'list:List installed and available targets' \ +'add:Add a target to a Rust toolchain' \ +'remove:Remove a target from a Rust toolchain' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup target commands' commands "$@" +} +(( $+functions[_rustup__toolchain_commands] )) || +_rustup__toolchain_commands() { + local commands; commands=( +'list:List installed toolchains' \ +'install:Install or update a given toolchain' \ +'uninstall:Uninstall a toolchain' \ +'link:Create a custom toolchain by symlinking to a directory' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'rustup toolchain commands' commands "$@" +} +(( $+functions[_rustup__self__uninstall_commands] )) || +_rustup__self__uninstall_commands() { + local commands; commands=() + _describe -t commands 'rustup self uninstall commands' commands "$@" +} +(( $+functions[_rustup__toolchain__uninstall_commands] )) || +_rustup__toolchain__uninstall_commands() { + local commands; commands=() + _describe -t commands 'rustup toolchain uninstall commands' commands "$@" +} +(( $+functions[_rustup__uninstall_commands] )) || +_rustup__uninstall_commands() { + local commands; commands=() + _describe -t commands 'rustup uninstall commands' commands "$@" +} +(( $+functions[_rustup__override__unset_commands] )) || +_rustup__override__unset_commands() { + local commands; commands=() + _describe -t commands 'rustup override unset commands' commands "$@" +} +(( $+functions[_rustup__self__update_commands] )) || +_rustup__self__update_commands() { + local commands; commands=() + _describe -t commands 'rustup self update commands' commands "$@" +} +(( $+functions[_rustup__update_commands] )) || +_rustup__update_commands() { + local commands; commands=() + _describe -t commands 'rustup update commands' commands "$@" +} +(( $+functions[_rustup__self__upgrade-data_commands] )) || +_rustup__self__upgrade-data_commands() { + local commands; commands=() + _describe -t commands 'rustup self upgrade-data commands' commands "$@" +} +(( $+functions[_rustup__which_commands] )) || +_rustup__which_commands() { + local commands; commands=() + _describe -t commands 'rustup which commands' commands "$@" +} + +_rustup "$@" diff --git a/.zsh/zfunc/_diesel b/.zsh/zfunc/_diesel new file mode 100644 index 0000000..3dbe838 --- /dev/null +++ b/.zsh/zfunc/_diesel @@ -0,0 +1,692 @@ +#compdef diesel + +autoload -U is-at-least + +_diesel() { + 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[@]}" : \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_diesel_commands" \ +"*::: :->diesel" \ +&& ret=0 + case $state in + (diesel) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-command-$line[1]:" + case $line[1] in + (migration) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +":: :_diesel__migration_commands" \ +"*::: :->migration" \ +&& ret=0 + + case $state in + (migration) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-migration-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +'(-a --all)-n+[Reverts the last \`n\` migration files.]: : ' \ +'(-a --all)--number=[Reverts the last \`n\` migration files.]: : ' \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'(-n --number)-a[Reverts previously run migration files.]' \ +'(-n --number)--all[Reverts previously run migration files.]' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(redo) +_arguments "${_arguments_options[@]}" : \ +'(-a --all)-n+[Redo the last \`n\` migration files.]: : ' \ +'(-a --all)--number=[Redo the last \`n\` migration files.]: : ' \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'(-n --number)-a[Reverts and re-runs all migrations.]' \ +'(-n --number)--all[Reverts and re-runs all migrations.]' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(pending) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(generate) +_arguments "${_arguments_options[@]}" : \ +'--version=[The version number to use when generating the migration. Defaults to the current timestamp, which should suffice for most use cases.]: : ' \ +'--format=[The format of the migration to be generated.]: :(sql)' \ +'--diff-schema=[Populate the generated migrations based on the current difference between your \`schema.rs\` file and the specified database. The generated migrations are not expected to be perfect. Be sure to check whether they meet your expectations. Adjust the generated output if that'\''s not the case.]' \ +'*--schema-key=[select schema key from diesel.toml, use '\''default'\'' for print_schema without key.]: : ' \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'-u[Don'\''t generate a down.sql file. You won'\''t be able to run migration \`revert\` or \`redo\`.]' \ +'--no-down[Don'\''t generate a down.sql file. You won'\''t be able to run migration \`revert\` or \`redo\`.]' \ +'--sqlite-integer-primary-key-is-bigint[For SQLite 3.37 and above, detect \`INTEGER PRIMARY KEY\` columns as \`BigInt\`, when the table isn'\''t declared with \`WITHOUT ROWID\`. See https\://www.sqlite.org/lang_createtable.html#rowid for more information. Only used with the \`--diff-schema\` argument.]' \ +'*-o[Only include tables from table-name that matches regexp.]' \ +'*--only-tables[Only include tables from table-name that matches regexp.]' \ +'*-e[Exclude tables from table-name that matches regex.]' \ +'*--except-tables[Exclude tables from table-name that matches regex.]' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +':MIGRATION_NAME -- The name of the migration to create.:' \ +'*::table-name -- Table names to filter.:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_diesel__migration__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-migration-help-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(redo) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(pending) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(generate) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(database) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +":: :_diesel__database_commands" \ +"*::: :->database" \ +&& ret=0 + + case $state in + (database) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-database-command-$line[1]:" + case $line[1] in + (setup) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +'--migration-dir=[The location of your migration directory. By default this will look for a directory called \`migrations\` in the current directory and its parents.]: :_files' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_diesel__database__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-database-help-command-$line[1]:" + case $line[1] in + (setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(completions) +_arguments "${_arguments_options[@]}" : \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +':SHELL:(bash elvish fish powershell zsh)' \ +&& ret=0 +;; +(print-schema) +_arguments "${_arguments_options[@]}" : \ +'-s+[The name of the schema.]: : ' \ +'--schema=[The name of the schema.]: : ' \ +'*--with-docs-config=[Render documentation comments for tables and columns.]: :(database-comments-fallback-to-auto-generated-doc-comment only-database-comments no-doc-comments)' \ +'*--column-sorting=[Sort order for table columns.]: :(ordinal_position name)' \ +'*--patch-file=[A unified diff file to be applied to the final schema.]: :_files' \ +'*--import-types=[A list of types to import for every table, separated by commas.]: : ' \ +'*--except-custom-type-definitions=[A list of regexes to filter the custom types definitions generated]: : ' \ +'*--custom-type-derives=[A list of derives to implement for every automatically generated SqlType in the schema, separated by commas.]: : ' \ +'*--schema-key=[select schema key from diesel.toml, use '\''default'\'' for print_schema without key.]: : ' \ +'--database-url=[Specifies the database URL to connect to. Falls back to the DATABASE_URL environment variable if unspecified.]: : ' \ +'--config-file=[The location of the configuration file to use. Falls back to the \`DIESEL_CONFIG_FILE\` environment variable if unspecified. Defaults to \`diesel.toml\` in your project root. See diesel.rs/guides/configuring-diesel-cli for documentation on this file.]: :_files' \ +'*-o[Only include tables from table-name that matches regexp.]' \ +'*--only-tables[Only include tables from table-name that matches regexp.]' \ +'*-e[Exclude tables from table-name that matches regex.]' \ +'*--except-tables[Exclude tables from table-name that matches regex.]' \ +'*--with-docs[Render documentation comments for tables and columns.]' \ +'*--no-generate-missing-sql-type-definitions[Generate SQL type definitions for types not provided by diesel]' \ +'*--sqlite-integer-primary-key-is-bigint[For SQLite 3.37 and above, detect \`INTEGER PRIMARY KEY\` columns as \`BigInt\`, when the table isn'\''t declared with \`WITHOUT ROWID\`. See https\://www.sqlite.org/lang_createtable.html#rowid for more information.]' \ +'--locked-schema[Require that the schema file is up to date.]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +'*::table-name -- Table names to filter.:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +":: :_diesel__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-help-command-$line[1]:" + case $line[1] in + (migration) +_arguments "${_arguments_options[@]}" : \ +":: :_diesel__help__migration_commands" \ +"*::: :->migration" \ +&& ret=0 + + case $state in + (migration) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-help-migration-command-$line[1]:" + case $line[1] in + (run) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(revert) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(redo) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(list) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(pending) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(generate) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(database) +_arguments "${_arguments_options[@]}" : \ +":: :_diesel__help__database_commands" \ +"*::: :->database" \ +&& ret=0 + + case $state in + (database) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:diesel-help-database-command-$line[1]:" + case $line[1] in + (setup) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(reset) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(drop) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; +(completions) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(print-schema) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" : \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_diesel_commands] )) || +_diesel_commands() { + local commands; commands=( +'migration:A group of commands for generating, running, and reverting migrations.' \ +'setup:Creates the migrations directory, creates the database specified in your DATABASE_URL, and runs existing migrations.' \ +'database:A group of commands for setting up and resetting your database.' \ +'completions:Generate shell completion scripts for the diesel command.' \ +'print-schema:Print table definitions for database schema.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel commands' commands "$@" +} +(( $+functions[_diesel__completions_commands] )) || +_diesel__completions_commands() { + local commands; commands=() + _describe -t commands 'diesel completions commands' commands "$@" +} +(( $+functions[_diesel__database_commands] )) || +_diesel__database_commands() { + local commands; commands=( +'setup:Creates the database specified in your DATABASE_URL, and then runs any existing migrations.' \ +'reset:Resets your database by dropping the database specified in your DATABASE_URL and then running \`diesel database setup\`.' \ +'drop:Drops the database specified in your DATABASE_URL.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel database commands' commands "$@" +} +(( $+functions[_diesel__database__drop_commands] )) || +_diesel__database__drop_commands() { + local commands; commands=() + _describe -t commands 'diesel database drop commands' commands "$@" +} +(( $+functions[_diesel__database__help_commands] )) || +_diesel__database__help_commands() { + local commands; commands=( +'setup:Creates the database specified in your DATABASE_URL, and then runs any existing migrations.' \ +'reset:Resets your database by dropping the database specified in your DATABASE_URL and then running \`diesel database setup\`.' \ +'drop:Drops the database specified in your DATABASE_URL.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel database help commands' commands "$@" +} +(( $+functions[_diesel__database__help__drop_commands] )) || +_diesel__database__help__drop_commands() { + local commands; commands=() + _describe -t commands 'diesel database help drop commands' commands "$@" +} +(( $+functions[_diesel__database__help__help_commands] )) || +_diesel__database__help__help_commands() { + local commands; commands=() + _describe -t commands 'diesel database help help commands' commands "$@" +} +(( $+functions[_diesel__database__help__reset_commands] )) || +_diesel__database__help__reset_commands() { + local commands; commands=() + _describe -t commands 'diesel database help reset commands' commands "$@" +} +(( $+functions[_diesel__database__help__setup_commands] )) || +_diesel__database__help__setup_commands() { + local commands; commands=() + _describe -t commands 'diesel database help setup commands' commands "$@" +} +(( $+functions[_diesel__database__reset_commands] )) || +_diesel__database__reset_commands() { + local commands; commands=() + _describe -t commands 'diesel database reset commands' commands "$@" +} +(( $+functions[_diesel__database__setup_commands] )) || +_diesel__database__setup_commands() { + local commands; commands=() + _describe -t commands 'diesel database setup commands' commands "$@" +} +(( $+functions[_diesel__help_commands] )) || +_diesel__help_commands() { + local commands; commands=( +'migration:A group of commands for generating, running, and reverting migrations.' \ +'setup:Creates the migrations directory, creates the database specified in your DATABASE_URL, and runs existing migrations.' \ +'database:A group of commands for setting up and resetting your database.' \ +'completions:Generate shell completion scripts for the diesel command.' \ +'print-schema:Print table definitions for database schema.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel help commands' commands "$@" +} +(( $+functions[_diesel__help__completions_commands] )) || +_diesel__help__completions_commands() { + local commands; commands=() + _describe -t commands 'diesel help completions commands' commands "$@" +} +(( $+functions[_diesel__help__database_commands] )) || +_diesel__help__database_commands() { + local commands; commands=( +'setup:Creates the database specified in your DATABASE_URL, and then runs any existing migrations.' \ +'reset:Resets your database by dropping the database specified in your DATABASE_URL and then running \`diesel database setup\`.' \ +'drop:Drops the database specified in your DATABASE_URL.' \ + ) + _describe -t commands 'diesel help database commands' commands "$@" +} +(( $+functions[_diesel__help__database__drop_commands] )) || +_diesel__help__database__drop_commands() { + local commands; commands=() + _describe -t commands 'diesel help database drop commands' commands "$@" +} +(( $+functions[_diesel__help__database__reset_commands] )) || +_diesel__help__database__reset_commands() { + local commands; commands=() + _describe -t commands 'diesel help database reset commands' commands "$@" +} +(( $+functions[_diesel__help__database__setup_commands] )) || +_diesel__help__database__setup_commands() { + local commands; commands=() + _describe -t commands 'diesel help database setup commands' commands "$@" +} +(( $+functions[_diesel__help__help_commands] )) || +_diesel__help__help_commands() { + local commands; commands=() + _describe -t commands 'diesel help help commands' commands "$@" +} +(( $+functions[_diesel__help__migration_commands] )) || +_diesel__help__migration_commands() { + local commands; commands=( +'run:Runs all pending migrations.' \ +'revert:Reverts the specified migrations.' \ +'redo:Reverts and re-runs the latest migration. Useful for testing that a migration can in fact be reverted.' \ +'list:Lists all available migrations, marking those that have been applied.' \ +'pending:Returns true if there are any pending migrations.' \ +'generate:Generate a new migration with the given name, and the current timestamp as the version.' \ + ) + _describe -t commands 'diesel help migration commands' commands "$@" +} +(( $+functions[_diesel__help__migration__generate_commands] )) || +_diesel__help__migration__generate_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration generate commands' commands "$@" +} +(( $+functions[_diesel__help__migration__list_commands] )) || +_diesel__help__migration__list_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration list commands' commands "$@" +} +(( $+functions[_diesel__help__migration__pending_commands] )) || +_diesel__help__migration__pending_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration pending commands' commands "$@" +} +(( $+functions[_diesel__help__migration__redo_commands] )) || +_diesel__help__migration__redo_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration redo commands' commands "$@" +} +(( $+functions[_diesel__help__migration__revert_commands] )) || +_diesel__help__migration__revert_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration revert commands' commands "$@" +} +(( $+functions[_diesel__help__migration__run_commands] )) || +_diesel__help__migration__run_commands() { + local commands; commands=() + _describe -t commands 'diesel help migration run commands' commands "$@" +} +(( $+functions[_diesel__help__print-schema_commands] )) || +_diesel__help__print-schema_commands() { + local commands; commands=() + _describe -t commands 'diesel help print-schema commands' commands "$@" +} +(( $+functions[_diesel__help__setup_commands] )) || +_diesel__help__setup_commands() { + local commands; commands=() + _describe -t commands 'diesel help setup commands' commands "$@" +} +(( $+functions[_diesel__migration_commands] )) || +_diesel__migration_commands() { + local commands; commands=( +'run:Runs all pending migrations.' \ +'revert:Reverts the specified migrations.' \ +'redo:Reverts and re-runs the latest migration. Useful for testing that a migration can in fact be reverted.' \ +'list:Lists all available migrations, marking those that have been applied.' \ +'pending:Returns true if there are any pending migrations.' \ +'generate:Generate a new migration with the given name, and the current timestamp as the version.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel migration commands' commands "$@" +} +(( $+functions[_diesel__migration__generate_commands] )) || +_diesel__migration__generate_commands() { + local commands; commands=() + _describe -t commands 'diesel migration generate commands' commands "$@" +} +(( $+functions[_diesel__migration__help_commands] )) || +_diesel__migration__help_commands() { + local commands; commands=( +'run:Runs all pending migrations.' \ +'revert:Reverts the specified migrations.' \ +'redo:Reverts and re-runs the latest migration. Useful for testing that a migration can in fact be reverted.' \ +'list:Lists all available migrations, marking those that have been applied.' \ +'pending:Returns true if there are any pending migrations.' \ +'generate:Generate a new migration with the given name, and the current timestamp as the version.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'diesel migration help commands' commands "$@" +} +(( $+functions[_diesel__migration__help__generate_commands] )) || +_diesel__migration__help__generate_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help generate commands' commands "$@" +} +(( $+functions[_diesel__migration__help__help_commands] )) || +_diesel__migration__help__help_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help help commands' commands "$@" +} +(( $+functions[_diesel__migration__help__list_commands] )) || +_diesel__migration__help__list_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help list commands' commands "$@" +} +(( $+functions[_diesel__migration__help__pending_commands] )) || +_diesel__migration__help__pending_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help pending commands' commands "$@" +} +(( $+functions[_diesel__migration__help__redo_commands] )) || +_diesel__migration__help__redo_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help redo commands' commands "$@" +} +(( $+functions[_diesel__migration__help__revert_commands] )) || +_diesel__migration__help__revert_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help revert commands' commands "$@" +} +(( $+functions[_diesel__migration__help__run_commands] )) || +_diesel__migration__help__run_commands() { + local commands; commands=() + _describe -t commands 'diesel migration help run commands' commands "$@" +} +(( $+functions[_diesel__migration__list_commands] )) || +_diesel__migration__list_commands() { + local commands; commands=() + _describe -t commands 'diesel migration list commands' commands "$@" +} +(( $+functions[_diesel__migration__pending_commands] )) || +_diesel__migration__pending_commands() { + local commands; commands=() + _describe -t commands 'diesel migration pending commands' commands "$@" +} +(( $+functions[_diesel__migration__redo_commands] )) || +_diesel__migration__redo_commands() { + local commands; commands=() + _describe -t commands 'diesel migration redo commands' commands "$@" +} +(( $+functions[_diesel__migration__revert_commands] )) || +_diesel__migration__revert_commands() { + local commands; commands=() + _describe -t commands 'diesel migration revert commands' commands "$@" +} +(( $+functions[_diesel__migration__run_commands] )) || +_diesel__migration__run_commands() { + local commands; commands=() + _describe -t commands 'diesel migration run commands' commands "$@" +} +(( $+functions[_diesel__print-schema_commands] )) || +_diesel__print-schema_commands() { + local commands; commands=() + _describe -t commands 'diesel print-schema commands' commands "$@" +} +(( $+functions[_diesel__setup_commands] )) || +_diesel__setup_commands() { + local commands; commands=() + _describe -t commands 'diesel setup commands' commands "$@" +} + +if [ "$funcstack[1]" = "_diesel" ]; then + _diesel "$@" +else + compdef _diesel diesel +fi From 77aa12bf56b5794c47c76d8fb8e040d8c43f07ad Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 26 Jul 2024 17:52:01 +0200 Subject: [PATCH 08/11] zshrc from work --- .zshrc | 60 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/.zshrc b/.zshrc index a91551b..9c1b09e 100644 --- a/.zshrc +++ b/.zshrc @@ -60,8 +60,28 @@ function condac() { } # calculate on shell with `c 1+1` function c() { printf "%s\n" "$@" | bc -l; } -# call python in a print from args -function py() { python -c "from math import *; print($*)" } +# Call Python and execute multiple statements from args +function py() { + python <<< " +from math import * + +def evaluate_and_print(code): + for expr in code.split(';'): + expr = expr.strip() + if '=' in expr: + exec(expr) + else: + result = eval(expr) + print(f\"{expr} => {result}\") + +if __name__ == \"__main__\": + expr = '$*' + evaluate_and_print(expr) +" +} +function countlines() { + find . -type f -name "$1" -exec wc -l {} \; | awk '{print $0} {total += $1} END {print "Total lines:", total}' +} ### ---- zsh options ------------------------------------- setopt autocd @@ -89,14 +109,6 @@ setopt hist_ignore_dups # ignore duplicated commands history list setopt hist_ignore_space # ignore commands that start with space setopt hist_verify # show command with history expansion to user before running it -### load unversioned zsh code -if [ -f ~/.zsh.local ]; then - source ~/.zsh.local -else - touch ~/.zsh.local -fi - - ### --- Inputs Config ------------------------------------ # vim keys, then override stuff. bindkey -v @@ -188,11 +200,16 @@ fpath=($ZSH/plugins/zsh-completions/src $fpath) ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m') ZAQ_PREFIXES_GREEDY+=('py #') +ZAQ_PREFIXES_GREEDY+=('countlines #') ### --- fzf Config ------------------------------------ export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'" export FZF_CTRL_R_OPTS='--no-sort --exact' +### --- nnn Config ------------------------------------ +source ~/.local/share/nnn/quitcd/quitcd.bash_zsh +export NNN_PLUG='j:jump;z:autojump;' + ### --- kitty Config ------------------------------------ # $KITTY_TERM is a custom envar I set in the kitty conf # this stuff does not work nicely with tmux, just make them regular aliases. Shows an error if you use them in another terminal @@ -215,11 +232,20 @@ else eval "$(zoxide init zsh)" fi -### --- pyenv Config ------------------------------------- -if [ -d $HOME/.pyenv ]; then - export PYENV_ROOT="$HOME/.pyenv" - [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init - zsh)" - pyenv activate std 2> /dev/null > /dev/null +### load unversioned zsh code +if [ -f ~/.zsh.local ]; then + source ~/.zsh.local +else + touch ~/.zsh.local fi + +### --- pyenv Config ------------------------------------- +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init - zsh)" + +. "$HOME/.cargo/env" + +zstyle ':completion:*' menu select +fpath+=~/.zfunc From a991769cef7e282541665dd17a1441ca37485129 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 1 Aug 2024 17:17:31 +0200 Subject: [PATCH 09/11] sync nvim --- .config/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim b/.config/nvim index 2a6fb44..38fb445 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 2a6fb440abc22a21d20fb3e4166f414ec43f495a +Subproject commit 38fb445fb1631b73ad3a12ee01b30d74464fb0f0 From ac2076fc03b8b6f269b7c271c6df1b8e61a2ab60 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 14 Aug 2024 10:09:03 +0200 Subject: [PATCH 10/11] zprofile ibus stuff --- .config/nvim | 2 +- .zprofile | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.config/nvim b/.config/nvim index 38fb445..9fed026 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 38fb445fb1631b73ad3a12ee01b30d74464fb0f0 +Subproject commit 9fed026ab76016f71df5dac7db9686c364b07c21 diff --git a/.zprofile b/.zprofile index cad08d2..195dbf0 100644 --- a/.zprofile +++ b/.zprofile @@ -3,8 +3,9 @@ export PATH="/usr/bin:/usr/sbin:$HOME/.local/bin:$HOME/.cargo/bin:/usr/local/bin export EDITOR=nvim export editor=nvim export XDG_CONFIG_HOME=~/.config -export GTK_IM_MODULE=fcitx -export QT_IM_MODULE=fcitx -export SDL_IM_MODULE=fcitx -export GLFW_IM_MODULE=ibus +export GTK_IM_MODULE=ibus +export QT_IM_MODULE=ibus +export SDL_IM_MODULE=ibus +export GLFW_IM_MODULE=ibus +export XMODIFIERS=@im=ibus From ba3b2ac1c9830f5b311cd5c2096f91de74e4859b Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 5 Sep 2024 10:50:10 +0200 Subject: [PATCH 11/11] git-verify-commit --- .zshrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.zshrc b/.zshrc index 9c1b09e..847a9e7 100644 --- a/.zshrc +++ b/.zshrc @@ -82,6 +82,16 @@ if __name__ == \"__main__\": function countlines() { find . -type f -name "$1" -exec wc -l {} \; | awk '{print $0} {total += $1} END {print "Total lines:", total}' } +function git-verify-commit () { +git verify-commit $1 +ret=$? +if [ $ret -ne 0 ]; then + echo "Commit is not signed." +else + echo "OK" +fi +return $ret +} ### ---- zsh options ------------------------------------- setopt autocd