Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何防止Emacs在打开多个文件时水平分割屏幕?_Emacs - Fatal编程技术网

如何防止Emacs在打开多个文件时水平分割屏幕?

如何防止Emacs在打开多个文件时水平分割屏幕?,emacs,Emacs,我希望能够使用Emacs打开多个文件,如以下命令所示: emacs file1 file2 并在Emacs启动时将Emacs屏幕(而不是)水平拆分。在不同的缓冲区中打开文件是我所期望的,在整个Emacs窗口中只显示一个文件 那我该怎么做呢 您可以像这样设置(tcsh)别名 alias emacs emacs -eval '"(run-with-idle-timer 0 nil (quote delete-other-windows))"' 这会使emacs隐藏所有其他窗口(因此您只有一个窗口

我希望能够使用Emacs打开多个文件,如以下命令所示:

emacs file1 file2
并在Emacs启动时将Emacs屏幕(而不是)水平拆分。在不同的缓冲区中打开文件是我所期望的,在整个Emacs窗口中只显示一个文件

那我该怎么做呢

您可以像这样设置(tcsh)别名

alias emacs emacs -eval '"(run-with-idle-timer 0 nil (quote delete-other-windows))"'
这会使emacs隐藏所有其他窗口(因此您只有一个窗口)。那么你的祈祷

emacs file1 file2
翻译成

emacs -eval '"(run-with-idle-timer 0 nil (quote delete-other-windows))"' file1 file2

令人讨厌和刻薄,但它是有效的:

$ emacs -nw --eval "(mapcar 'find-file '(\"1.txt\" \"2.txt\"))"

或者在emacs加载后只需按C-x 1

就我个人而言,如果从命令行调用emacs,我认为这是在误用emacs。我倾向于访问eshell中的文件,eshell在emacs中运行

(add-hook 'window-setup-hook 'delete-other-windows)

按我想要的方式工作。。。我在这里询问后才发现。

一次显示多个缓冲区非常有价值。有了大显示器,我可以显示4个缓冲区,每个缓冲区都是可用的。这不是我通常需要的,但当我需要的时候……如果你真的解释了如何从eshell内部访问文件,而不是仅仅提到你喜欢这样做,这将是一个很好的答案,或者解释了在非分割屏幕模式下成功打开缓冲区后如何循环缓冲区。您可以使用
查找文件
从eshell访问文件。