49 |
|
|
50 |
(defvar vip-insert-local-map nil |
(defvar vip-insert-local-map nil |
51 |
"Local map used in insert command mode. (Buffer-specific.)") |
"Local map used in insert command mode. (Buffer-specific.)") |
52 |
|
|
53 |
(make-variable-buffer-local 'vip-emacs-local-map) |
(make-variable-buffer-local 'vip-emacs-local-map) |
54 |
(make-variable-buffer-local 'vip-insert-local-map) |
(make-variable-buffer-local 'vip-insert-local-map) |
55 |
|
|
113 |
|
|
114 |
(defvar vip-f-forward nil |
(defvar vip-f-forward nil |
115 |
"For use by \";\" command.") |
"For use by \";\" command.") |
116 |
|
|
117 |
(defvar vip-f-offset nil |
(defvar vip-f-offset nil |
118 |
"For use by \";\" command.") |
"For use by \";\" command.") |
119 |
|
|
378 |
'delete-backward-char)) |
'delete-backward-char)) |
379 |
(define-key vip-insert-local-map "\C-w" |
(define-key vip-insert-local-map "\C-w" |
380 |
'vip-delete-backward-word)) |
'vip-delete-backward-word)) |
381 |
((eq new-mode 'emacs-mode) |
((eq new-mode 'emacs-mode) |
382 |
(vip-change-mode-line "Emacs:") |
(vip-change-mode-line "Emacs:") |
383 |
(use-local-map vip-emacs-local-map))) |
(use-local-map vip-emacs-local-map))) |
384 |
(setq vip-current-mode new-mode) |
(setq vip-current-mode new-mode) |
508 |
"Compute numeric prefix arg value. Invoked by CHAR. VALUE is the value |
"Compute numeric prefix arg value. Invoked by CHAR. VALUE is the value |
509 |
obtained so far, and COM is the command part obtained so far." |
obtained so far, and COM is the command part obtained so far." |
510 |
(while (and (>= char ?0) (<= char ?9)) |
(while (and (>= char ?0) (<= char ?9)) |
511 |
(setq value (+ (* (if (numberp value) value 0) 10) (- char ?0))) |
(setq value (+ (* (if (numberp value) value 0) 10) (- char ?0))) |
512 |
(setq char (read-char))) |
(setq char (read-char))) |
513 |
(setq prefix-arg value) |
(setq prefix-arg value) |
514 |
(if com (setq prefix-arg (cons prefix-arg com))) |
(if com (setq prefix-arg (cons prefix-arg com))) |
561 |
(setq com char) |
(setq com char) |
562 |
(setq char (read-char))))))) |
(setq char (read-char))))))) |
563 |
(if (atom com) |
(if (atom com) |
564 |
;; com is a single char, so we construct prefix-arg |
;; com is a single char, so we construct prefix-arg |
565 |
;; and if char is ?, describe prefix arg, otherwise exit by |
;; and if char is ?, describe prefix arg, otherwise exit by |
566 |
;; pushing the char back |
;; pushing the char back |
567 |
(progn |
(progn |
615 |
(interactive "P") |
(interactive "P") |
616 |
(condition-case conditions |
(condition-case conditions |
617 |
(vip-prefix-arg-com |
(vip-prefix-arg-com |
618 |
last-command-char |
last-command-char |
619 |
(cond ((null arg) nil) |
(cond ((null arg) nil) |
620 |
((consp arg) (car arg)) |
((consp arg) (car arg)) |
621 |
((numberp arg) arg) |
((numberp arg) arg) |
935 |
command was invoked with argument > 1." |
command was invoked with argument > 1." |
936 |
(let ((i-com (car vip-d-com)) (val (car (cdr vip-d-com)))) |
(let ((i-com (car vip-d-com)) (val (car (cdr vip-d-com)))) |
937 |
(if (and val (> val 1)) ;; first check that val is non-nil |
(if (and val (> val 1)) ;; first check that val is non-nil |
938 |
(progn |
(progn |
939 |
(setq vip-d-com (list i-com (1- val) ?r)) |
(setq vip-d-com (list i-com (1- val) ?r)) |
940 |
(vip-repeat nil) |
(vip-repeat nil) |
941 |
(setq vip-d-com (list i-com val ?r)))))) |
(setq vip-d-com (list i-com val ?r)))))) |
1037 |
(vip-change-subr (mark) (point)) |
(vip-change-subr (mark) (point)) |
1038 |
(vip-change (mark) (point)))) |
(vip-change (mark) (point)))) |
1039 |
(setq vip-d-com (list 'vip-substitute val ?r)))) |
(setq vip-d-com (list 'vip-substitute val ?r)))) |
1040 |
|
|
1041 |
(defun vip-substitute-line (arg) |
(defun vip-substitute-line (arg) |
1042 |
"Substitute lines." |
"Substitute lines." |
1043 |
(interactive "p") |
(interactive "p") |
1057 |
(interactive "P") |
(interactive "P") |
1058 |
(let ((val (vip-p-val arg))) |
(let ((val (vip-p-val arg))) |
1059 |
(vip-line (cons val ?Y)))) |
(vip-line (cons val ?Y)))) |
1060 |
|
|
1061 |
|
|
1062 |
;; region command |
;; region command |
1063 |
|
|
1076 |
(move-marker vip-com-point (point)) |
(move-marker vip-com-point (point)) |
1077 |
(exchange-point-and-mark) |
(exchange-point-and-mark) |
1078 |
(vip-execute-com 'vip-Region val com))) |
(vip-execute-com 'vip-Region val com))) |
1079 |
|
|
1080 |
(defun vip-replace-char (arg) |
(defun vip-replace-char (arg) |
1081 |
"Replace the following ARG chars by the character read." |
"Replace the following ARG chars by the character read." |
1082 |
(interactive "P") |
(interactive "P") |
1171 |
(progn |
(progn |
1172 |
(forward-char) |
(forward-char) |
1173 |
(vip-execute-com 'vip-end-of-word val com))))) |
(vip-execute-com 'vip-end-of-word val com))))) |
1174 |
|
|
1175 |
(defun vip-backward-word (arg) |
(defun vip-backward-word (arg) |
1176 |
"Backward word." |
"Backward word." |
1177 |
(interactive "P") |
(interactive "P") |
2911 |
(vip-change-mode-to-emacs) |
(vip-change-mode-to-emacs) |
2912 |
(shell)) |
(shell)) |
2913 |
|
|
2914 |
(defun ex-substitute (&optional repeat r-flag) |
(defun ex-substitute (&optional repeat r-flag) |
2915 |
"ex substitute. |
"ex substitute. |
2916 |
If REPEAT use previous reg-exp which is ex-reg-exp or |
If REPEAT use previous reg-exp which is ex-reg-exp or |
2917 |
vip-s-string" |
vip-s-string" |