Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: make vi-history-search(forward|backward) more vi-like



This is a (possibly Quixotic) follow-up to the thread at [1] and
swaps the current zsh bindings for vi-history-search-forward and
vi-history-search-backward, aligning them with vi* behaviour
i.e. bind '/' to search forward and '?' to search backward.

--- Src/Zle/zle_bindings.c	2015-08-12 20:07:17.000000000 +0100
+++ Src/Zle/zle_bindings.c.cor	2016-03-21 23:06:29.000000000 +0000
@@ -337,7 +337,7 @@
     /* , */ z_virevrepeatfind,
     /* - */ z_viuplineorhistory,
     /* . */ z_virepeatchange,
-    /* / */ z_vihistorysearchbackward,
+    /* ? */ z_vihistorysearchbackward,
     /* 0 */ z_vidigitorbeginningofline,
     /* 1 */ z_digitargument,
     /* 2 */ z_digitargument,
@@ -353,7 +353,7 @@
     /* < */ z_viunindent,
     /* = */ z_listchoices,
     /* > */ z_viindent,
-    /* ? */ z_vihistorysearchforward,
+    /* / */ z_vihistorysearchforward,
     /* @ */ z_undefinedkey,
     /* A */ z_viaddeol,
     /* B */ z_vibackwardblankword,

--- Doc/Zsh/zle.yo	2015-11-15 18:54:50.000000000 +0000
+++ Doc/Zsh/zle.yo.cor	2016-03-21 23:09:55.000000000 +0000
@@ -1502,7 +1502,7 @@
 first word in the buffer.
 )
 tindex(vi-history-search-backward)
-item(tt(vi-history-search-backward) (unbound) (tt(/)) (unbound))(
+item(tt(vi-history-search-backward) (unbound) (tt(?)) (unbound))(
 Search backward in the history for a specified string.
 The string may begin with `tt(^)' to anchor the search to the
 beginning of the line.
@@ -1542,7 +1542,7 @@
 first word in the buffer.
 )
 tindex(vi-history-search-forward)
-item(tt(vi-history-search-forward) (unbound) (tt(?)) (unbound))(
+item(tt(vi-history-search-forward) (unbound) (tt(/)) (unbound))(
 Search forward in the history for a specified string.
 The string may begin with `tt(^)' to anchor the search to the
 beginning of the line. The functions available in the mini-buffer are the same

[1]: http://www.zsh.org/mla/workers/2016/msg00283.html




Messages sorted by: Reverse Date, Date, Thread, Author