首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何删除(或删除) emacs中的当前单词?

如何删除(或删除) emacs中的当前单词?
EN

Stack Overflow用户
提问于 2015-10-31 01:49:37
回答 1查看 14.3K关注 0票数 13

例如,我的光标(point)位于单词" cursor“中的任意字母处。我想删除(删除)这个单词,这样它就会被复制到kill-ring

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-31 18:41:45

你可以使用它作为一个框架,在这一点上杀死各种东西:

代码语言:javascript
复制
(defun my-kill-thing-at-point (thing)
  "Kill the `thing-at-point' for the specified kind of THING."
  (let ((bounds (bounds-of-thing-at-point thing)))
    (if bounds
        (kill-region (car bounds) (cdr bounds))
      (error "No %s at point" thing))))

(defun my-kill-word-at-point ()
  "Kill the word at point."
  (interactive)
  (my-kill-thing-at-point 'word))

(global-set-key (kbd "s-k w") 'my-kill-word-at-point)
票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33442027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档