移动到Emacs中搜索查找的开始和结束 [英] Move to start and end of search lookup in Emacs

查看:110
本文介绍了移动到Emacs中搜索查找的开始和结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你在接受搜索时在搜索字符串的开头或结尾有什么意见?

How can you have the point at the beginning or end of the search string when accepting a search ?

所以说你做Csfoobar,我想当我按RET并在开始时将光标放在找到的字符串的末尾,如果我按C-RET。

So say you do C-s "foobar", I would like to have my cursor at the end of the found string when I press RET and at the beginning if I press 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)

这篇关于移动到Emacs中搜索查找的开始和结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆