2011-02-28 82 views

回答

52

在我的Debian測試中,alias emacs='emacs -nw'後跟emacs在終端中打開Emacs。並且,在同一個會話中,emacs23-x使用GUI打開Emacs。

+12

或'的X版本\ emacs'。這將調用原始的emacs而不是別名。我有三個別名:'enw ='\ emacs -nw -name -bg black -fg white -bd ForestGreen'','emacsx ='\ emacs -name Editor_Emacs_ $ USER @ $ HOST -geometry 80x50 -bg black -fg white -bd ForestGreen''和'emacs ='enw''使* nw * de默認。 – 2011-03-01 14:17:15

0
alias emacs='emacs -nw' 

或者

unset DISPLAY 
+1

清除DISPLAY的作品,但它假定你不想運行任何其他的X程序。 – Eponymous 2016-01-17 18:18:24

7

如果你決定使用emacs在終端模式總是,安裝emacs的硝(emacs的,沒有X支持)。

emacs的,所以你installationis仍然$跑後無需重新創建別名!:)

其存在於Debian中的回購擠我一定要在Ubuntu也。

3

This answer表明我發現的方法對我最有效(對別名有問題)。從本質上講,在你的shell RC文件中創建可執行腳本

#!/bin/sh 
emacs -nw "[email protected]" 

和點$EDITOR它。

0

我遇到了這個問題,並不想設置別名(因爲我也希望「emacs -nw」是我的默認外殼編輯器,但它不會工作),所以我開始思考並看到這一行在configure

If you are sure you want Emacs compiled without X window support, pass 
--without-x to configure. 

所以,如果你想下載並從源代碼編譯,你可以做

curl http://gnu.mirrors.hoobly.com/emacs/emacs-25.3.tar.xz 
tar -xvzf emacs-25.3.tar.xz && cd emacs-25.3 
./configure --without-x 
make && sudo make install