Last active
August 29, 2015 14:22
-
-
Save kergoth/ab858d8bfd37a4770592 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slash-backward-word() { | |
local WORDCHARS="${WORDCHARS:s@/@}" | |
zle backward-word | |
} | |
zle -N slash-backward-word | |
slash-forward-word() { | |
local WORDCHARS="${WORDCHARS:s@/@}" | |
zle forward-word | |
} | |
zle -N slash-forward-word | |
slash-backward-kill-word() { | |
local WORDCHARS="${WORDCHARS:s@/@}" | |
zle backward-kill-word | |
} | |
zle -N slash-backward-kill-word | |
# Default navigation/deletion for the entire path, not components | |
WORDCHARS="${WORDCHARS:s@/@}/" | |
# alt-shift-left navigates between path components | |
bindkey '^[[1;10D' slash-backward-word | |
# alt-shift-right navigates between path components | |
bindkey '^[[1;10C' slash-forward-word | |
# alt-backspace deletes one path component | |
bindkey '\e^?' slash-backward-kill-word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment