Function: viper-set-searchstyle-toggling-macros
viper-set-searchstyle-toggling-macros is an interactive and
byte-compiled function defined in viper-cmd.el.gz.
Signature
(viper-set-searchstyle-toggling-macros UNSET &optional MODE)
Documentation
Set the macros for toggling the search style in Viper's vi-state.
The macro that toggles case sensitivity is bound to //, and the one that
toggles regexp search is bound to ///.
With a prefix argument, this function unsets the macros.
If MODE is set, set the macros only in that major mode.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
(defun viper-set-searchstyle-toggling-macros (unset &optional mode)
"Set the macros for toggling the search style in Viper's vi-state.
The macro that toggles case sensitivity is bound to `//', and the one that
toggles regexp search is bound to `///'.
With a prefix argument, this function unsets the macros.
If MODE is set, set the macros only in that major mode."
(interactive "P")
(let ((scope (if (and mode (symbolp mode)) mode t)))
(or noninteractive
(if (not unset)
(progn
;; toggle case sensitivity in search
(viper-record-kbd-macro
"//" 'vi-state
[1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
scope)
;; toggle regexp/vanilla search
(viper-record-kbd-macro
"///" 'vi-state
[2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
scope)
(if (called-interactively-p 'interactive)
(message
"// and /// now toggle case-sensitivity and regexp search")))
(viper-unrecord-kbd-macro "//" 'vi-state)
(sit-for 2)
(viper-unrecord-kbd-macro "///" 'vi-state)))
))