0

I have just taken a C programming course. The computers we used in class were set up such that by typing the command: emacs filename.cthe linux terminal would open a new emacs window on the desktop.
Now I have a Mac and tried to make an alias to achieve the same by typing the following command in the terminal:

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

I found that on an older question (How to launch GUI Emacs from command line in OSX?). The command works but after closing the terminal and then re opening it if I type emacs filename.c it does not work anymore. So is there a way to create the alias permanently?

Community
  • 1
  • 1

1 Answers1

2

Try adding it to your profile:

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

The file ~/.profile is run when you log in, so that alias will be automatically created each time you log in.

flangford
  • 196
  • 4