.../../.../...../
This commit is contained in:
parent
9e4503772a
commit
d5d135a739
2 changed files with 27 additions and 0 deletions
22
zsh/expand-multiple-dots.zsh
Normal file
22
zsh/expand-multiple-dots.zsh
Normal file
|
@ -0,0 +1,22 @@
|
|||
function expand-multiple-dots() {
|
||||
local MATCH
|
||||
if [[ $LBUFFER =~ '(^| )\.\.\.+' ]]; then
|
||||
LBUFFER=$LBUFFER:fs%\.\.\.%../..%
|
||||
fi
|
||||
}
|
||||
|
||||
function expand-multiple-dots-then-expand-or-complete() {
|
||||
zle expand-multiple-dots
|
||||
zle expand-or-complete
|
||||
}
|
||||
|
||||
function expand-multiple-dots-then-accept-line() {
|
||||
zle expand-multiple-dots
|
||||
zle accept-line
|
||||
}
|
||||
|
||||
zle -N expand-multiple-dots
|
||||
zle -N expand-multiple-dots-then-expand-or-complete
|
||||
zle -N expand-multiple-dots-then-accept-line
|
||||
bindkey '^I' expand-multiple-dots-then-expand-or-complete
|
||||
bindkey '^M' expand-multiple-dots-then-accept-line
|
5
zshrc
5
zshrc
|
@ -14,6 +14,7 @@ zplug "zsh-users/zsh-completions", defer:2
|
|||
bindkey "$terminfo[kcuu1]" history-beginning-search-backward
|
||||
bindkey "$terminfo[kcud1]" history-beginning-search-forward
|
||||
|
||||
source $HOME/.zsh/expand-multiple-dots.zsh # cd .../.../<tab>?
|
||||
setopt prompt_subst # Make sure prompt is able to be generated properly.
|
||||
setopt auto_cd # Get that ~ in here.
|
||||
setopt hist_ignore_all_dups # Goodbye, random duplicates.
|
||||
|
@ -121,3 +122,7 @@ fi
|
|||
if [ -d $HOME/.ghcup ]; then
|
||||
export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
|
||||
fi
|
||||
|
||||
if [ -d $HOME/.fastlane ]; then
|
||||
export PATH="$HOME/.fastlane/bin:$PATH"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue