|
|
|
|
@ -328,17 +328,6 @@ BIG FAT WARNING: this needs to specify an actual file as a destination |
|
|
|
|
|
|
|
|
|
export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin" |
|
|
|
|
|
|
|
|
|
# rationalise-dot; useful for cd ......./whatever |
|
|
|
|
rationalise-dot() { |
|
|
|
|
if [[ $LBUFFER = *.. ]]; then |
|
|
|
|
LBUFFER+=/.. |
|
|
|
|
else |
|
|
|
|
LBUFFER+=. |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
zle -N rationalise-dot |
|
|
|
|
bindkey . rationalise-dot |
|
|
|
|
|
|
|
|
|
bindkey -s '^[(' '()^B' |
|
|
|
|
bindkey -s '^[{' '{}^B' |
|
|
|
|
# Make ctrl-Backspace work |
|
|
|
|
@ -346,6 +335,27 @@ BIG FAT WARNING: this needs to specify an actual file as a destination |
|
|
|
|
|
|
|
|
|
autoload zmv |
|
|
|
|
#+end_src |
|
|
|
|
This expands ... to ../.. and so on. See [[https://stackoverflow.com/questions/23456873/multi-dot-paths-in-zsh-like-cd][this post]] for source and |
|
|
|
|
further reference |
|
|
|
|
#+begin_src sh |
|
|
|
|
if is-at-least 5.0.0 && [[ ! $UID -eq 0 ]]; then |
|
|
|
|
## http://www.zsh.org/mla/users/2010/msg00769.html |
|
|
|
|
function rationalize-dot() |
|
|
|
|
{ |
|
|
|
|
local MATCH # keep the regex match from leaking to the environment |
|
|
|
|
if [[ $LBUFFER =~ '(^|/| | |'$'\n''|\||;|&)\.\.$' && ! $LBUFFER = p4* ]]; then |
|
|
|
|
#if [[ ! $LBUFFER = p4* && $LBUFFER = *.. ]]; then |
|
|
|
|
LBUFFER+=/.. |
|
|
|
|
else |
|
|
|
|
zle self-insert |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
zle -N rationalize-dot |
|
|
|
|
bindkey . rationalize-dot |
|
|
|
|
bindkey -M isearch . self-insert |
|
|
|
|
fi |
|
|
|
|
#+end_src |
|
|
|
|
*** TODO editor env variables :daily: |
|
|
|
|
This needs to be diff'd among the versions |
|
|
|
|
#+begin_src sh |
|
|
|
|
|