2013-10-04 38 views
2

當打開兩個文件$ emacs a.txt b.txt的emacs時,窗口會垂直拆分。打開橫向拆分的emacs

我需要改爲水平分割。是否有一個控制這種行爲的變量,或者是否存在一個可以在不改變其他行爲的情況下覆蓋一個行爲的鉤子?

我看StackOverflow上相關的問題,但他們有不同的重點,他們的答案是不能直接適用:打開文件時

我想找到特定的代碼時,Emacs是打開並更改只是一個調用(split-window-vertically)運行。

萬一它很重要,我使用的是GNU Emacs 24.3.1。

回答

2

具體的代碼在命令行打開文件是startup.el。功能是command-line-1,它叫find-file-other-window(在兩個不同的地方)。

你應該能夠做這樣的事情在你的.emacs,但我不知道的細節:

(defadvice find-file-other-window (before split (file &optional wildcards)) 
    (if <during command line processing> 
     (split-window-horizontally))) 
(ad-activate 'find-file-other-window) 
0

有一個選項transpose 垂直/水平分割。非常方便和有趣。

2
emacs -Q a.txt -eval "(split-window-horizontally)" -eval "(find-file \"b.txt\")" 

也許設置一些字體也一樣,例如解放單-18:

emacs -Q a.txt -eval "(split-window-horizontally)" -eval "(find-file \"b.txt\")" --font 'Liberation Mono-18' 

沒有選項-Q加載您的init文件也。

嘛,只是爲了完整性,在一個文件的時候就已經:C-X 3