I have to run some C and Fortran programs over SSH, and need to edit the source files on the shell. I think Emacs is the right tool for such a task, and it was preinstalled on the server. Though when I open a Fortran source file (ending with .f08) in emacs, I find the syntax highlighting is just illegible (dark blue and dark purple text over black background).

Now I can change the theme by M-x customize-themes or M-x load-theme, but I have to do it each time I start emacs from the terminal. For instance if I make a small modification to the source, return to shell to compile, and come back to make another small modification (say correct an error) to my source file, I have to change themes twice over.

Hence my question is basically: Where do I configure emacs to load a particular theme every time it is opened in the terminal?

The server has GNU Emacs 24.3.1, and runs CentOS Linux release 7.1.1503 (Core).


For an emacs running on the remote machine, you can put your config in ~/.emacs.d/init.el on the remote machine, not on your local computer.

You may find that Tramp is a better option. With Tramp, you run Emacs on your local machine, and it can open files on the remote computer for editing. This means you have all your local customizations and packages, and you can continue to use GUI emacs even with a text-only connection. In addition, Tramp only sends data over the network when you save the file, so it may be less laggy than running Emacs on the remote machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.