有没有办法在缓冲区之间切换,而不必通过 缓冲区列表或写入我想要切换到的缓冲区的名称?更具体的我不知道Emacs可以缓冲区之间标签就像它是如何在记事本工作++缓冲区之间的Emacs选项卡
回答
Emacs的22.1及更高supports的previous-buffer
(C-x <left arrow>
)和next-buffer
(C-x <right arrow>
)命令。
可以使用this script将这两个命令添加到较老的Emacsen。
是否还有一个命令可以在最近的命令之间切换? – starcorn 2010-11-09 11:41:39
是的,请参阅我的答案中第一个链接中的“在两个最近使用的缓冲区之间切换”部分。 – 2010-11-09 11:43:00
我从来没有最终使用CX <权>或CX < C-右>了,因为我觉得他们繁琐重复,如果我想过去的周期超过一个缓冲区,所以我刚刚写了一对夫妇的功能,让你继续切换到next/previous-buffer
与< C-右>和< C-左>如果最后的命令也是一个next/previous-buffer
命令。
例如C-X < C-左> < C-左> < C-左> < C-右> < C-左>将带您回到三个缓存器,向前,向后一次。
我所做的假设,即< C-左> & < C-右>通常势必forward/backward-word
,和我呼吁那些明确作为后备。
(defun my-forward-word-or-buffer-or-windows (&optional arg)
"Enable <C-left> to call next-buffer if the last command was
next-buffer or previous-buffer, and winner-redo if the last
command was winner-undo or winner-redo."
(interactive "p")
(cond ((memq last-command (list 'next-buffer 'previous-buffer))
(progn (next-buffer)
(setq this-command 'next-buffer)))
((memq last-command (list 'winner-redo 'winner-undo))
(progn (winner-redo)
(setq this-command 'winner-redo)))
(t ;else
(progn (forward-word arg)
(setq this-command 'forward-word)))))
(defun my-backward-word-or-buffer-or-windows (&optional arg)
"Enable <C-left> to call previous-buffer if the last command
was next-buffer or previous-buffer, and winner-undo if the last
command was winner-undo or winner-redo."
(interactive "p")
(cond ((memq last-command (list 'next-buffer 'previous-buffer))
(progn (previous-buffer)
(setq this-command 'previous-buffer)))
((memq last-command (list 'winner-redo 'winner-undo))
(progn (winner-undo)
(setq this-command 'winner-undo)))
(t ;else
(progn (backward-word arg)
(setq this-command 'backward-word)))))
(global-set-key (kbd "<C-left>") 'my-backward-word-or-buffer-or-windows)
(global-set-key (kbd "<C-right>") 'my-forward-word-or-buffer-or-windows)
(我用Icicles缓冲区交换,我自己,但是......)
如果你想重复以前的命令任意次数,只要使用CX ZZZZZZ ......在这种情况下,例如,CX离开CX ZZZ ......
如果真是太麻烦了,绑定(next|previous)-buffer
以外,重复键,如其他人所说。
但可重复的钥匙需求量很大。如果你不想浪费任何东西,你甚至可以把这些命令放在一个前缀键上,这样,例如,你可以这样做,例如,Cx左上角的左边 ......这是一个诀窍,在Bookmark+代码):
(defun my-repeat-command (command) "Repeat COMMAND." (let ((repeat-message-function 'ignore)) (setq last-repeatable-command command) (repeat nil))) (defun my-next-whatever-repeat (arg) ; `C-x right' "Jump to the Nth-next whatever. N defaults to 1, meaning the next whatever. Plain `C-u' means start over at the first whatever (and no repeat)." (interactive "P") (require 'repeat) (my-repeat-command 'next-whatever)) (define-key ctl-x-map [right] 'my-next-whatever-repeat
- 1. XEmacs缓冲区选项卡不显示所有缓冲区
- 2. Emacs erlang缓冲区
- 3. Markdownize Emacs缓冲区
- 4. 如何在emacs中的可见缓冲区之间切换?
- 5. Cocoa Emacs打印缓冲区
- 6. Emacs缓冲区组/标签
- 7. emacs:非连续缓冲区
- 8. 在Emacs小缓冲区
- 9. 如何恢复emacs缓冲区列表中的缓冲区?
- 10. 让emacs grep缓冲区使用特定的emacs缓冲区来显示命中
- 11. 关闭缓冲区后显示Emacs缓冲区
- 12. Emacs意外地将缓冲区切换到临时缓冲区
- 13. vim中的每个选项卡的缓冲区
- 14. 双缓冲方法之间的区别
- 15. Emacs缓冲区内的OpenGL上下文
- 16. 的Emacs迷你缓冲区完成
- 17. 所有emacs缓冲区中的行号
- 18. 得到Emacs中缓冲区的数量
- 19. Vim:在新选项卡中打开每个缓冲区
- 20. vim在现有选项卡中打开缓冲区
- 21. 在Emacs中立即终止缓冲缓冲区
- 22. Emacs shell输出缓冲区高度
- 23. 将Emacs缓冲区传递给C
- 24. emacs缓冲区绑定到密钥
- 25. 如何创建Emacs SQL缓冲区?
- 26. 在Emacs缓冲区中渲染Markdown
- 27. 维护emacs缓冲区历史
- 28. Emacs ansi-term最大缓冲区大小?
- 29. Emacs - 多列一个缓冲区
- 30. Emacs保存缓冲区键绑定?
这个问题也问(并回答不同)以上的超级用户:http://superuser.com/questions/208871/emacs-tab-between-buffers – jwernerny 2010-11-09 13:50:19
我试过很多,并最终停在一个简单的iflip包http://www.emacswiki上。org/emacs-ja/iflipb随着时间的推移,你会发现几乎没有比“C-x b”更好的切换+ ido-mode – VitoshKa 2010-11-09 21:18:38