簡體   English   中英

在Emacs開放時自定義窗口

[英]Customize windows at opening of Emacs

我想從終端啟動emacs中的三個文件,並將emacs中的窗口拆分為三個,這樣三個窗口每個包含一個文件。 窗戶以某種方式划分對我來說也很重要。 我可以通過打開emacs並按Cx 3,Cx o,Cx 2來手動獲得正確的拆分。任何人都知道如何通過配置.emacs或通過bash-scripting來做到這一點? 我這樣打開大約300個文件,所以自動這樣做會幫助我很多。

編輯:我每次打開3個不同的文件。 我很樂意,如果我可以從這樣的終端打開:emacs file1 file2 file3

然后為接下來的三個文件emacs file4文件5 file6

以防萬一: - 運行Linux - 使用emacs-newest

這樣做你想要的嗎?

(defun open-files (first second third)
  (interactive "fFirst: \nfSecond: \nfThird: ")
  (find-file first)
  (split-window-horizontally)
  (other-window 1)
  (find-file second)
  (split-window-vertically)
  (other-window 1)
  (find-file third))

編輯 :我已經使該功能交互,也可以從命令行調用它,如下所示:

emacs --eval='(open-files "/tmp/first" "/tmp/second" "/tmp/third")'

你可以將它包裝在一個bash腳本中,以便更容易調用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM