diff options
author | self <george@gabbott.dev> | 2023-03-07 20:45:35 +0000 |
---|---|---|
committer | self <george@gabbott.dev> | 2023-03-07 20:45:35 +0000 |
commit | cf885ff98fe573235c7a0433257afdf8b2a1b0e6 (patch) | |
tree | 7f560b8e6544c0f93d874568b7fee16d544bde7a | |
parent | 62e2239a28045b8216c0fd6995bf5326405b5603 (diff) |
cdtld + make cd aliases faster
-rw-r--r-- | zsh/.zshrc | 15 | ||||
-rw-r--r-- | zsh/.zshrc-git | 1 |
2 files changed, 5 insertions, 11 deletions
@@ -1,3 +1,4 @@ +#!/bin/zsh # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. @@ -72,13 +73,9 @@ abbrev-alias x="clear; ls" abbrev-alias t="ls --tree" # cd aliases, from $ORGD_CDALIAS_PATH -strip-comments "$ORGD_CDALIAS_PATH" | strip-blank > /tmp/orgd-cd-aliases -while read l ; do - a="cd$(echo $l | awk -F' ' '{print $1}')"; - c="$(echo $l | awk -F' ' '{print $2}')" - alias $a="cd $c" -done < /tmp/orgd-cd-aliases -rm /tmp/orgd-cd-aliases +while read a c ; do + alias "cd$a"="cd $c" +done <<< "$(strip-comments "$ORGD_CDALIAS_PATH" | strip-blank)" # vim / nvim @@ -136,10 +133,6 @@ autoload -Uz compinit compinit # End of lines added by compinstall -# z - must go after compinit -eval "$(zoxide init zsh --cmd cd)" - - # Sourcing for zsh source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh diff --git a/zsh/.zshrc-git b/zsh/.zshrc-git index 5777921..d91c886 100644 --- a/zsh/.zshrc-git +++ b/zsh/.zshrc-git @@ -44,3 +44,4 @@ abbrev-alias grr="git-rename-remotes" abbrev-alias gpr="git-print-remotes" abbrev-alias gcr="git-clone-add-remotes" abbrev-alias gua="git-update-all" +alias cdtld='cd $(git rev-parse --show-toplevel)' |