ohmyzsh/plugins/refresh/refresh.plugin.zsh
Julien Nicoulaud 2b61ddee5b Allow to use another key
Use $terminfo to get key codes
2010-12-01 17:09:15 +01:00

16 lines
560 B
Bash
Executable file

#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Simple ZLE widget that binds F5 to "source ~/.zshrc".
#
# You can bind it to another ikey by setting the REFRESH_KEY
# environment variable, for example to bind F4 instead of F5:
# export REFRESH_KEY=$terminfo[kf4]
# ------------------------------------------------------------------------------
# Default key is F5.
DEFAULT_REFRESH_KEY=$terminfo[kf5]
_refresh() { source ~/.zshrc }
zle -N _refresh
bindkey ${REFRESH_KEY:-$DEFAULT_REFRESH_KEY} _refresh