Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
接受搜索时,如何在搜索字符串的开头或结尾找到点?
所以说你做Cs“foobar”,当我按下RET时,我想把我的光标放在找到的字符串的末尾,如果我按下C-RET,我想把光标放在开头。
谢谢
试试这个:
(defun my-isearch-exit-other-end () "Exit isearch at the other end" (interactive) (when isearch-forward (goto-char isearch-other-end)) (isearch-exit)) (define-key isearch-mode-map (kbd "<C-return>") 'my-isearch-exit-other-end)