【问题标题】:can't make an alias on mac terminal to open emacs on a new window无法在 mac 终端上创建别名以在新窗口中打开 emacs
【发布时间】:2015-12-23 16:47:36
【问题描述】:

我刚刚参加了 C 编程课程。我们在课堂上使用的计算机设置为通过键入命令:emacs filename.clinux 终端将在桌面上打开一个新的 emacs 窗口。
现在我有一台 Mac,并尝试通过在终端中键入以下命令来创建一个别名以实现相同的目的:

alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs "$@""   

我在一个较旧的问题 (How to launch GUI Emacs from command line in OSX?) 上发现了这一点。该命令有效,但在关闭终端后,如果我输入 emacs filename.c 则重新打开它,它不再有效。那么有没有办法永久创建别名?

【问题讨论】:

    标签: macos emacs


    【解决方案1】:

    尝试将其添加到您的个人资料中:

    echo 'alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs "$@""' >> ~/.profile
    

    文件~/.profile在你登录时运行,所以每次登录时都会自动创建别名。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-05
      • 2012-04-24
      • 2017-03-07
      • 1970-01-01
      • 2019-02-17
      • 1970-01-01
      • 2013-08-12
      相关资源
      最近更新 更多