(or (viper-overlay-p viper-replace-overlay)
(viper-set-replace-overlay (point-min) (point-min)))
(viper-hide-replace-overlay)
(or (viper-overlay-p viper-replace-overlay)
(viper-set-replace-overlay (point-min) (point-min)))
(viper-hide-replace-overlay)
(if (and auto-fill-function (> (current-column) fill-column))
(funcall auto-fill-function))
;; don't leave whitespace lines around
(if (and auto-fill-function (> (current-column) fill-column))
(funcall auto-fill-function))
;; don't leave whitespace lines around
"Function that implements ESC key in Viper emulation of Vi."
(interactive)
(let ((cmd (or (key-binding (viper-envelop-ESC-key))
"Function that implements ESC key in Viper emulation of Vi."
(interactive)
(let ((cmd (or (key-binding (viper-envelop-ESC-key))
;; call the actual function to execute ESC (if no other symbols followed)
;; or the key bound to the ESC sequence (if the sequence was issued
;; call the actual function to execute ESC (if no other symbols followed)
;; or the key bound to the ESC sequence (if the sequence was issued
(insert " ")(backward-char 1)))
(if (= viper-com-point (point))
(viper-forward-char-carefully))
(insert " ")(backward-char 1)))
(if (= viper-com-point (point))
(viper-forward-char-carefully))
(viper-backward-char-carefully)) ; give back the newline
(if (eq viper-intermediate-command 'viper-repeat)
(viper-change-subr (mark t) (point))
(viper-backward-char-carefully)) ; give back the newline
(if (eq viper-intermediate-command 'viper-repeat)
(viper-change-subr (mark t) (point))
;; call viper-execute-com to execute viper-exec-change, which eventually will
;; call viper-change to invoke the replace mode on the region.
;;
;; call viper-execute-com to execute viper-exec-change, which eventually will
;; call viper-change to invoke the replace mode on the region.
;;
;; via a call to viper-set-destructive-command, for later use by viper-repeat.
(defun viper-execute-com (m-com val com)
(let ((reg viper-use-register))
;; via a call to viper-set-destructive-command, for later use by viper-repeat.
(defun viper-execute-com (m-com val com)
(let ((reg viper-use-register))
convenient way to use it is to bind `//' to the macro
`1 M-x viper-toggle-search-style' and `///' to
`2 M-x viper-toggle-search-style'. In this way, hitting `//' quickly will
convenient way to use it is to bind `//' to the macro
`1 M-x viper-toggle-search-style' and `///' to
`2 M-x viper-toggle-search-style'. In this way, hitting `//' quickly will