opening more than one file split vertically through emacs -nw

China☆狼群 提交于 2019-12-03 07:24:35

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.

By default emacs will pick a vertical or horizontal split based on the size of your terminal.

If you want emacs to put files side by side no matter how wide your terminal add this to your .emacs:

(setq split-width-threshold 0)

If you want emacs to put files one above the other no matter how short your terminal is add this to your .emacs:

(setq split-height-threshold 0)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!