移至Emacs中搜索查找的开始和结束

时间:2012-07-27 15:49:29

标签: emacs

接受搜索时,如何在搜索字符串的开头或结尾处显示该点?

所以说你做C-s" foobar",当我按下RET时,我想将光标放在找到的字符串的末尾,如果我按下C-RET,我希望将光标放在找到的字符串的末尾。

由于

1 个答案:

答案 0 :(得分:2)

试试这个:

(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)
相关问题