简体   繁体   中英

Reopen buffer in split view

Is there an built-in option in emacs to toggle between full window and a split window, so that both files remain the same? As if minimizing one buffer for a while. Currently, when I do Cx 3 to split vertically it will open the same buffer, I then open a file in the other window. But at some point I want to concentrate fully on one part again and "minimize" the other half of the window. And later I want to unminimize and have both files shown again. Is this toggling of emacs windows possible?

NB: I use term "window" in emacsian.

I'm using `winner-mode' for this purpose:

(winner-mode)
(global-set-key [f9] 'delete-other-windows)
(global-set-key [C-f9] 'delete-window)
(global-set-key (kbd "<f7>") 'winner-undo)
(global-set-key (kbd "C-<f7>") 'winner-redo)

This way

  • f9 "maximizes" the current window,
  • f7 restores the previous configuration.
  • C-f9 "minimizes" the current window.

I rarely use C-f7 , just included it for completeness.

您可以使用窗口配置寄存器

@Seanmcl's answer is a good one, as is @abo-abo's.

Depending on how you work or just what you want to do, you can also use Cx 5 2 to open the current buffer in a new frame. And then use Cx 5 0 there to delete that frame when done focusing on that buffer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM