2021-12-31 11:54:55 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
|
|
|
|
|
function init_rc_configure_zle
|
|
|
|
|
{
|
2022-01-22 09:11:53 -08:00
|
|
|
ShellLog 'Configuring ZLE'
|
2022-01-22 09:03:43 -08:00
|
|
|
|
2021-12-31 11:54:55 -08:00
|
|
|
local mode=$1
|
|
|
|
|
if [[ -z "$mode" ]]; then
|
|
|
|
|
mode=emacs
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
function configure_zle_emacs { }
|
|
|
|
|
function configure_zle_vim { }
|
|
|
|
|
|
2022-01-22 09:11:53 -08:00
|
|
|
ShellLog -l debug "Using $mode command line editing mode"
|
2021-12-31 11:54:55 -08:00
|
|
|
if [[ $mode == 'vim' ]]; then
|
|
|
|
|
bindkey -v
|
|
|
|
|
configure_zle_vim
|
|
|
|
|
zle -A .backward-delete-char vi-backward-delete-char
|
|
|
|
|
elif [[ $mode == 'emacs' ]]; then
|
|
|
|
|
bindkey -e
|
|
|
|
|
configure_zle_emacs
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init_rc_configure_zle "$@"
|