打开多个文件通过emacs -nw垂直分割 [英] opening more than one file split vertically through emacs -nw

查看:154
本文介绍了打开多个文件通过emacs -nw垂直分割的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 emacs -nw file1 file2 我可以一次打开多个文件。然而,emacs将以水平拆分方式打开它们。有没有办法将默认拆分行为设置为垂直?我看过:



ToggleWindowSplit



如果我可以每次打开多个可以做我正在寻找的文件时自动调用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:

ToggleWindowSplit

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屋!

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