并排打开“撤消树可视化”到缓冲区,而不是“垂直”打开
有什么方法可以使 undo-tree-mode在“水平”缓冲区中显示可视化(即 Cx 3 与 Cx 2)?
Is there any way I can make undo-tree-mode display the visualization in a "horizontal" buffer (ie. C-x 3 vs. C-x 2)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据@Tom的 建议,我提出了一个仅适用于撤消树的解决方案:
2017-04-29:
defadvice
现已弃用,取而代之的是advice-add
。上述解决方案的更新版本如下:As per @Tom's suggestion, I whipped up a solution that applies only to undo-tree:
2017-04-29:
defadvice
is now deprecated in favour ofadvice-add
. The updated version of the solution above would be the following:undo-tree 包使用标准 Emacs 缓冲区显示函数来显示树窗口(而不是特定函数)。要控制 Emacs 拆分窗口的方式,您可以自定义变量
split-window-preferred-function
、split-height-threshold
和split-width-threshold< /代码>。另请查看 split-window-sensible 函数的文档。
如果您对 Emacs 通常更喜欢并排窗口而不是上下窗口,请将此代码放入您的 init 文件中:(
如果您只希望并排窗口用于 undo-tree-可视化,这个故事有点复杂。)
The
undo-tree
package uses standard Emacs buffer display functions to show the tree window (as opposed to a specific function). To control how Emacs splits windows, you can customize the variablessplit-window-preferred-function
,split-height-threshold
, andsplit-width-threshold
. Also check out the documentation for the functionsplit-window-sensibly
.If you are OK with Emacs in general preferring side-by-side windows over top-and-bottom ones, put this code in your init file:
(If you want side-by-side windows only for
undo-tree-visualize
, the story is a little more complicated.)