mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Allow to use another key
Use $terminfo to get key codes
This commit is contained in:
parent
6c4bffca66
commit
2b61ddee5b
1 changed files with 9 additions and 1 deletions
10
plugins/refresh/refresh.plugin.zsh
Normal file → Executable file
10
plugins/refresh/refresh.plugin.zsh
Normal file → Executable file
|
|
@ -1,8 +1,16 @@
|
|||
#!/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 '^[[15~' _refresh
|
||||
bindkey ${REFRESH_KEY:-$DEFAULT_REFRESH_KEY} _refresh
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue