如何使空间汇编缓冲区水平拆分



我正在我的dotspacemacs/user-config中设置(setq split-width-threshold 100),以便在窗口足够宽时将各种缓冲液水平拆分。这是针对Magit状态等的工作。

但是,编译日志缓冲区似乎无视此,并且始终在底部打开。

如何使汇编缓冲区粘附在split-width-threshold上?或者,如何使它总是水平分裂?

我对emacs和spacemacs都是很新的。

汇编不遵守设置的原因是,默认情况下启用了 purpose-mode。如果您使用它,则是根据需要修改目的布局的问题。但是,如果您不使用purpose-mode,则禁用它为我解决问题。为了尝试一下,您可以进行SPC SPC purpose-mode RET,然后(只有一个窗口打开(运行编译。

这是一种方法(SPC f e d到达配置文件,然后您可以将其放入现有的dotspacemacs-user-config函数中( - 在这里,我已经显示了如何获得GREP和右侧弹出的汇编缓冲区:

(require 'dash)
(defun my/popwin-on-right (alist-item)
  (let ((props-alist (seq-partition (cdr alist-item) 2)))
    (setf (alist-get :position props-alist) '(right))
    (setf (alist-get :height props-alist) '(1.0))
    (setf (alist-get :width props-alist) '(0.5))
    (let ((flattened (apply #'append props-alist)))
      (cons (car alist-item) flattened))))
(custom-set-variables
  '(popwin:special-display-config
    (--map-when (-contains? '("*compilation*" "*grep*") (car it))
                (my/popwin-on-right it)
                popwin:special-display-config)))

,或者您可以直接设置popwin:special-display-config,用文字列表替换--map-when呼叫。只需查看变量的现有值,例如使用 SPC SPC ielm <RET>获取良好的格式,然后将其切成薄片并粘贴到中(您需要使用'引用列表(。或者,当我想将可自定义变量设置为文字值时,您可以做我要做的事:使用SPC SPC customize,让该更新带有生成代码斑点的blob blob的spacemacs config文件的结尾,然后复制自定义 - 设定变量,生成您的dotspacemacs-user-config,然后删除customize生成的代码的斑点(。

来自另一个答案

(setq split-height-threshold nil)
(setq split-width-threshold 0)

如果您希望这些设置仅影响compile

(defadvice compile (around split-horizontally activate)
  (let ((split-width-threshold 0)
        (split-height-threshold nil))
    ad-do-it))

最新更新