- 268 名前:名無しさん@お腹いっぱい。 mailto:sage [04/09/12 04:07:53]
- viperで、vimの"*"コマンドを実装した。
(define-key viper-vi-global-user-map "*" 'viper-exec-word-search-nearest-cursor) (define-key viper-vi-global-user-map "#" '(lambda () (interactive) (viper-exec-word-search-nearest-cursor t))) (define-key viper-vi-global-user-map "g*" '(lambda () (interactive) (viper-exec-word-search-nearest-cursor nil t))) (define-key viper-vi-global-user-map "g#" '(lambda () (interactive) (viper-exec-word-search-nearest-cursor t t))) (defun viper-exec-word-search-nearest-cursor (&optional reverse unbound) "Emulate vim \"*\" command." (interactive) (let ((word (viper-surrounding-word 1 1))) (when (stringp word) (setq viper-s-string (if unbound word (concat "\\<" word "\\>"))) (setq viper-s-forward (not reverse)) (setq viper-search-history (cons viper-s-string viper-search-history)) (setq viper-intermediate-command 'viper-exec-word-search-nearest-cursor) (viper-search viper-s-string viper-s-forward 1))))
|

|