From f21828ae0af06aabbec20011dee13691786a419d Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:14:46 +0200 Subject: [PATCH] Add some more zsh nicetohaves --- zsh/.config/zsh/.zlogin | 13 +++++++++++++ zsh/.config/zsh/.zshrc | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 zsh/.config/zsh/.zlogin diff --git a/zsh/.config/zsh/.zlogin b/zsh/.config/zsh/.zlogin new file mode 100644 index 0000000..df5bac0 --- /dev/null +++ b/zsh/.config/zsh/.zlogin @@ -0,0 +1,13 @@ +# Function to determine the need of a zcompile. If the .zwc file +# does not exist, or the base file is newer, we need to compile. +# These jobs are asynchronous, and will not impact the interactive shell +zcompare() { + if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then + zcompile ${1} + fi +} + +emulate zsh -o extended_glob -c "local files=($ZDOTDIR/*/*.zsh)" +for file in "${files[@]}"; do + zcompare $file +done diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 4a45396..0d80be1 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -22,6 +22,8 @@ zplug "zsh-users/zsh-history-substring-search", defer:2 zplug "zdharma/fast-syntax-highlighting", defer:2 zplug "zsh-users/zsh-autosuggestions" zplug "olets/zsh-abbr" +zplug "sudosubin/zsh-github-cli" +zplug "pkulev/zsh-rustup-completion" if ! zplug check --verbose; then printf "Install? [y/N]: " @@ -63,6 +65,7 @@ bindkey '^W' my-backward-delete-word bindkey '^H' backward-delete-word bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line +bindkey "^[." insert-last-word bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down