how to delete region with [delete] key in emacs

只愿长相守 提交于 2019-12-12 11:01:44

问题


I am using Emacs 23.3 on Mac OS X Lion. How can I delete the selected text region with simple key typing—something like delete or C-d? This works on windows without setting anything specific. How can I implement that in Mac OS X Lion?


回答1:


Try M-xcua-mode. This will change a lot of things about the way Emacs behaves to fit the behavior of other GUI applications. For more information, see M-S-:(info "(emacs) CUA Bindings").

You can turn it on persistently with M-xcustomize-optionRETcua-mode.




回答2:


You need to enable delete-selection-mode and then it will work ;-)




回答3:


If you mean "delete between the mark and the cursor," the normal keybinding for this in Emacs is C-w (Hold down control and press w).

To set the mark, use C-SPC (hold down control and press SPACE).

Selecting a text region and then deleting it is not very common to normal Emacs users. More frequently they use

  • C-k to delete entire lines at a time (or to the end of the current line)
  • M-z (press Esc then z) to "zap to char" which will delete all text to the next occurrence of any character
  • M-DEL (press Esc then DEL) to delete backwards a whole word at a time

and others.



来源:https://stackoverflow.com/questions/7924205/how-to-delete-region-with-delete-key-in-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!