Emacs重新排列拆分窗格 [英] Emacs rearrange split panes

查看:51
本文介绍了Emacs重新排列拆分窗格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在(终端)Emacs中工作,并且使用水平分割在屏幕上有2个缓冲区:

If I'm working in (terminal) Emacs and have 2 buffers on screen using a horizontal split:

+--------------------------+
|                          |
|                          |
|                          |
|                          |
+--------------------------+
|                          |
|                          |
|                          |
|                          |
+--------------------------+

然后我决定打开粘液替换,Emacs将垂直拆分其中一个水平窗格:

Then I decide to open the slime repl, Emacs will split one of those horizontal panes vertically:

+--------------------------+
|                          |
|                          |
|                          |
|                          |
+-------------+------------+
|             |            |
|             |  slime     |
|             |            |
|             |            |
+-------------+------------+

但是我想要的是使用窗口的整个高度在右侧放置粘液:

But what I want is to have slime on the right, using the full height of the window:

+-------------+------------+
|             |            |
|             |            |
|             |            |
|             |            |
+-------------+  slime     |
|             |            |
|             |            |
|             |            |
|             |            |
+-------------+------------+

从Emacs自动给我的安排到我想要的安排(例如旋转安排),是否有任何简便的方法,还是我自己明确关闭并重新分割窗户?

Is there any easy way to get from the arrangement Emacs automatically gave me, to the one I want (e.g. a rotate arrangement), or do I explicitly close and re-split the windows myself?

编辑|如果我现在正在使用完整的水平分割,或者实际上是不可能的,是否可以直接打开完整的垂直分割,也很好奇.

EDIT | Also curious if I can directly open a full vertical split if I'm currently using a full horizontal split, or if it's effectively impossible.

推荐答案

如果您喜欢预设的窗口配置,请查看工作区管理"工具:

If you like pre-set window configurations, take a look at the "workspace management" pakages:

  • 透视图为您提供了命名的工作区
  • 平衡Emacs窗口管理器类似但更复杂的工具,允许配置弹出窗口位置,窗口配置,缓冲区,字体和键绑定.
  • Perspective gives you named workspaces
  • Equilibrium Emacs Window Manager is similar but more sophisticated tool which allows to configure popup placement, window configuraion, buffers, fonts and keybindings.

EmacsWiki上的项目管理页上有更多内容.

There is more on the project management page on EmacsWiki.

对于您的第二个问题,这是我在配置中可以翻转水平/垂直拆分的内容(来源:https://github.com/yyr/emacs.d ):

To your second question, here is what I have in my configuration to flip horizontal/vertical splits (credit: https://github.com/yyr/emacs.d):

(defun split-window-func-with-other-buffer (split-function)
  (lexical-let ((s-f split-function))
    (lambda ()
      (interactive)
      (funcall s-f)
      (set-window-buffer (next-window) (other-buffer)))))

(defun split-window-horizontally-instead ()
  (interactive)
  (save-excursion
    (delete-other-windows)
    (funcall (split-window-func-with-other-buffer 'split-window-horizontally))))

(defun split-window-vertically-instead ()
  (interactive)
  (save-excursion
    (delete-other-windows)
    (funcall (split-window-func-with-other-buffer 'split-window-vertically))))

(global-set-key "\C-x|" 'split-window-horizontally-instead)
(global-set-key "\C-x_" 'split-window-vertically-instead)

这篇关于Emacs重新排列拆分窗格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆