zsh move with dots
This commit is contained in:
parent
84aa3c7dcd
commit
9791b73f51
24
.zshrc
24
.zshrc
|
@ -74,6 +74,30 @@ bindkey "^[[1;5C" forward-word
|
|||
bindkey "^[[1;5D" backward-word
|
||||
bindkey -s "^X" 'n^M'
|
||||
|
||||
### ---- EXPAND DOTS -------------------------------------
|
||||
function expand-dots() {
|
||||
local MATCH
|
||||
if [[ $LBUFFER =~ '(^| )\.\.\.+' ]]; then
|
||||
LBUFFER=$LBUFFER:fs%\.\.\.%../..%
|
||||
fi
|
||||
}
|
||||
|
||||
function expand-dots-then-expand-or-complete() {
|
||||
zle expand-dots
|
||||
zle expand-or-complete
|
||||
}
|
||||
|
||||
function expand-dots-then-accept-line() {
|
||||
zle expand-dots
|
||||
zle accept-line
|
||||
}
|
||||
|
||||
zle -N expand-dots
|
||||
zle -N expand-dots-then-expand-or-complete
|
||||
zle -N expand-dots-then-accept-line
|
||||
bindkey '^I' expand-dots-then-expand-or-complete
|
||||
bindkey '^M' expand-dots-then-accept-line
|
||||
|
||||
### ---- THEMES -----------------------------------
|
||||
PS1='%B%F{red}%n@%m%k %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k'
|
||||
|
||||
|
|
Loading…
Reference in New Issue