English 中文(简体)
标语:明确缓冲的关键是什么?
原标题:Emacs: what is the shortcut key to clear buffer?
  • 时间:2011-02-03 13:34:05
  •  标签:
  • emacs

Control-A(所有选取)之后删除?

最佳回答

C-x h + del 缓冲

<>注: 这就需要<条码>允许(以缺省为准)。

问题回答

如何使用:

M-x erase-buffer

Which you could bind to whatever you want.

选择所有工作地点:

C-x h

(从技术上说,这 mark了全方位的)和杀人区(杀害标志性区域,现在是整个缓冲区)是:

C-w

如果你想要删除这个区域,而不将其复制给杀人团伙,你可以使用。

M-x delete-region

相反。 如果你这样做的话,你就希望把删除区域与一个关键/关键 com体联系在一起。

这些宏观办法以上述答案为基础。 他们开始把他们带入你的ema子,然后重新启用 em子或(同时在缓冲器中)M-x Eval-buffer。

(defun clear-buffer ()
  "clear whole buffer add contents to the kill ring"
  (interactive)
  (kill-region (point-min) (point-max))
  )

(defun clear-buffer-permenantly ()
  "clear whole buffer, contents is not added to the kill ring"
  (interactive)
  (delete-region (point-min) (point-max))
  )

Old folks might like to call it hk rather than clear-buffer-permanently, and assign it to the nostalgic key sequence like so:

(define-key esc-map "^[hk"  hk)

That s the pre-Gnu TECO EMACS command to clear the buffer (ESC ESC wHole Kill).

Go to the begin of the buffer, go to the end (both set the mark), then cut:

M-< M-> C-w

There is no shortcut, but you can define one... Follow this link to get a macro for clearing a buffer.





相关问题
suppress additional braces in emacs electric mode

I started using ruby-electric-mode. I like it except that I am used to closing open brackets myself (the other pairing are still useful to me). How can I make emacs suppress additional brackets when ...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything ...

Emacs Setting which-function-mode

I would like to have which-function-mode on by default when I open up Emacs. I ve added the following lines to my .emacs file. (setq which-func-mode t) (setq which-function-mode t) When I open ...

Enabling go mode for emacs

I don t seem to be able to enable a go mode for emacs. C mode doesn t work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn t require ...

Custom Emacs key bindings are not working

The key bindings I ve defined in my .emacs file aren t working. Here s the file: ;init modes (menu-bar-mode 0) (tool-bar-mode 0) (cua-mode) (column-number-mode) (fset perl-mode cperl-mode) (cperl-...

eval during emacs lisp macro expansion

How can I fix the simple macro foo in (elisp)Eval During Expansion? None of the followings work: (defmacro foo1 (a) `(setq (eval ,a) t)) (defmacro foo2 (a) `(setq ,(eval a) t)) (defmacro foo3 (...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签