打开多个文件通过emacs -nw垂直分割 [英] opening more than one file split vertically through emacs -nw
问题描述
使用 emacs -nw file1 file2
我可以一次打开多个文件。然而,emacs将以水平拆分方式打开它们。有没有办法将默认拆分行为设置为垂直?我看过:
如果我可以每次打开多个可以做我正在寻找的文件时自动调用emacs。
$ b $我也看过这个SO帖子。
他们的建议在$中添加
(setq split-height-threshold nil)
和(setq split-width-threshold 0)
c $ c>〜/ .emacs 没有为我工作。我已经分开尝试了他们一起。在你的init文件中,添加 toggle-window-split 功能代码。然后,将以下代码行添加到您的init文件中:
(add-hook'emacs-startup-hook'toggle-窗口分割)
每次启动emac时,这将自动调用toggle-window-split函数。如果您在命令行上启动带有2个文件的emacs,它们将以垂直分割显示。
Using emacs -nw file1 file2
I can open multiple files at once. However, emacs will open them in horizontal splits. Is there a way to set default split behavior to vertical? I have looked at:
If I could have emacs call that automatically every time I open multiple files that would do what I am looking for.
I also looked at this SO post.
Their suggestion of adding (setq split-height-threshold nil)
and (setq split-width-threshold 0)
in ~/.emacs
did not work for me. I have tried them separately and together.
In your init file, add the toggle-window-split function code. Then, add the following line of code to your init file:
(add-hook 'emacs-startup-hook 'toggle-window-split)
This will call the toggle-window-split function automatically every time you startup emacs. If you startup emacs with 2 files on the command line, they will be displayed in vertical splits.
这篇关于打开多个文件通过emacs -nw垂直分割的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!