在最新的emacs27.1上没法正常使用,按第二次 * 或者 # 的时候会随机搜索一个buffer中的别的字符串,被迫撸了个简陋的替代版本
(defun my/search-selection-forward (beg end)
(interactive "r")
(let ((inputstr (buffer-substring-no-properties beg end)))
(evil-normal-state)
(evil-search inputstr t)))
(defun my/search-selection-backward (beg end)
(interactive "r")
(let ((inputstr (buffer-substring-no-properties beg end)))
(evil-normal-state)
(evil-search inputstr nil)))