diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index d90838f03..8e5ad3fa2 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -1454,8 +1454,8 @@ default_bindings(void) linkkeymap(oppmap, "viopp", 0); linkkeymap(vismap, "visual", 0); linkkeymap(smap, ".safe", 1); - if (((ed = zgetenv("VISUAL")) && strstr(ed, "vi")) || - ((ed = zgetenv("EDITOR")) && strstr(ed, "vi"))) + if (((ed = zgetenv("VISUAL")) && strstr(ed, "vi") > rindex(ed, '/')) || + ((ed = zgetenv("EDITOR")) && strstr(ed, "vi") > rindex(ed, '/'))) linkkeymap(vmap, "main", 0); else linkkeymap(emap, "main", 0);