From 3dd6007cb5239938f4a7eb7d533c88eaf75aeacd Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 01:50:55 +0300 Subject: [PATCH 1/6] Added .zimrc option 'zinput_mode' --- init.zsh | 5 +++++ templates/zimrc | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/init.zsh b/init.zsh index 7f5c6b6..172b52c 100755 --- a/init.zsh +++ b/init.zsh @@ -14,6 +14,11 @@ fi # Source user configuration [[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc +if zinput_mode='emacs'; then + set -o emacs +else + set -o vi + # Autoload module functions () { local mod_function diff --git a/templates/zimrc b/templates/zimrc index 203a7a6..e6cba01 100644 --- a/templates/zimrc +++ b/templates/zimrc @@ -26,6 +26,13 @@ zmodules=(directory environment git git-info history input utility custom \ # Set your desired prompt here zprompt_theme='steeef' +# +# Input +# + +# Set to vi or emacs +zinput_mode='emacs' + # # Completion # From 00c82206e6ca57aa198d45b586e5ae8cc83b3bb1 Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 01:54:22 +0300 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc896d7..48f00da 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 vi mode, set `zinput_mode` in `.zimrc`. Updating -------- From 9a03c73dc112625d9b6538996f302eddafe61b83 Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 02:03:39 +0300 Subject: [PATCH 3/6] Fixed init.zsh logic, changed .zimrc module order --- init.zsh | 8 +++++--- templates/zimrc | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/init.zsh b/init.zsh index 172b52c..eff22cb 100755 --- a/init.zsh +++ b/init.zsh @@ -14,10 +14,12 @@ fi # Source user configuration [[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc -if zinput_mode='emacs'; then - set -o emacs -else +# If necessary, set vi mode before loading modules +if zinput_mode='vi'; then set -o vi +else + set -o emacs +fi # Autoload module functions () { diff --git a/templates/zimrc b/templates/zimrc index e6cba01..ad47dbd 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) ################### From 727763feed5cc4c86d0476d024c48cb3884fd09c Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 02:09:19 +0300 Subject: [PATCH 4/6] Fixed the logic some more. --- init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.zsh b/init.zsh index eff22cb..cef9024 100755 --- a/init.zsh +++ b/init.zsh @@ -15,7 +15,7 @@ fi [[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc # If necessary, set vi mode before loading modules -if zinput_mode='vi'; then +if ${zinput_mode}='vi'; then set -o vi else set -o emacs From b92415af428115d7773087d1d5d1395a64e1a9b7 Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 02:24:27 +0300 Subject: [PATCH 5/6] Fixed init.zsh syntax, moved setting in .zimrc --- init.zsh | 4 ++-- templates/zimrc | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/init.zsh b/init.zsh index cef9024..3fe81e9 100755 --- a/init.zsh +++ b/init.zsh @@ -14,8 +14,8 @@ fi # Source user configuration [[ -s ${ZDOTDIR:-${HOME}}/.zimrc ]] && source ${ZDOTDIR:-${HOME}}/.zimrc -# If necessary, set vi mode before loading modules -if ${zinput_mode}='vi'; then +# 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 diff --git a/templates/zimrc b/templates/zimrc index ad47dbd..970efda 100644 --- a/templates/zimrc +++ b/templates/zimrc @@ -26,13 +26,6 @@ zmodules=(directory environment git git-info history input utility custom \ # Set your desired prompt here zprompt_theme='steeef' -# -# Input -# - -# Set to vi or emacs -zinput_mode='emacs' - # # Completion # @@ -64,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' From e41983cd677ac34b63d75edf6763ad117a3dd61a Mon Sep 17 00:00:00 2001 From: Anton Shiryaev Date: Fri, 6 Apr 2018 02:37:46 +0300 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48f00da..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. To set vi mode, set `zinput_mode` in `.zimrc`. +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 --------