diff --git a/README.md b/README.md index cc896d7..d8854ba 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Installing Zim is easy. If you have a different shell framework installed (like source ${ZDOTDIR:-${HOME}}/.zlogin ``` -5. You're done! Enjoy your Zsh IMproved! Take some time to read about the [available modules][modules] and tweak your `.zshrc` file. +5. You're done! Enjoy your Zsh IMproved! Take some time to read about the [available modules][modules] and tweak your `.zshrc` file. To set input mode, set `zinput_mode` in `.zimrc`. Updating -------- diff --git a/init.zsh b/init.zsh index 73afd2c..290cac9 100755 --- a/init.zsh +++ b/init.zsh @@ -13,6 +13,13 @@ fi # Source user configuration [[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc +# If necessary, set vi mode before loading modules to ensure history search with arrow keys works in vi mode +if [ ${zinput_mode}='vi' ]; then + set -o vi +else + set -o emacs +fi + # Autoload module functions () { local mod_function diff --git a/templates/zimrc b/templates/zimrc index 203a7a6..970efda 100644 --- a/templates/zimrc +++ b/templates/zimrc @@ -12,7 +12,7 @@ # The second line of modules may depend on options set by modules in the first # line. These dependencies are noted on the respective module's README.md. zmodules=(directory environment git git-info history input utility custom \ - syntax-highlighting history-substring-search prompt completion) + syntax-highlighting prompt completion history-substring-search) ################### @@ -57,6 +57,9 @@ ztermtitle='%n@%m:%~' # Input # +# Set to vi or emacs +zinput_mode='emacs' + # Uncomment to enable double-dot expansion. # This appends '../' to your input for each '.' you type after an initial '..' #zdouble_dot_expand='true'