Skip to content

Emacs

Setup

Setup on macOS

Emacs Installation

On macOS I installed the following (using Homebrew):

GitHub - railwaycat/homebrew-emacsmacport: Emacs mac port formulae for the Homebrew package manager

From the ReadMe:

Homebrew

If you'd like to install with Homebrew, please

$ brew tap railwaycat/emacsmacport

and then

$ brew install emacs-mac

if you using cask

brew cask install emacs-mac or
brew cask install emacs-mac-spacemacs-icon

To disable this tap, please:

$ brew untap railwaycat/emacsmacport

(I think I installed it via brew cask install emacs-mac)

Upgrade

Upgrade with the following homebrew cask command

brew cask upgrade

Setup on Windows

Emacs Installation

HN comment - re Emacs & VS Code

Emacs is great in many ways; I'm saying it as an avid user.

For ultimate multi-workplace setup, you can run Emacs in server mode on a cloud instance, and allow network connections to it, or port-forward to its Unix socket via SSH.

Now you can run Emacs in client mode from whatever machine you may have, several of them, or ssh to the cloud box and run Emacs in terminal mode in a crunch. All your sessions will share the same set of files, but workspace layout is per client, so you can work comfortably both from an 11" laptop screen and from a 27" 4K screen.

As said above, you can use tramp to access whatever other remote files accessible via ssh, and also run a decent (though a bit limited) terminal right from Emacs, to say nothing of running REPLs of all kinds directly, and excellent git integration with Magit.

This can even give you a sort of VPN-like access, when the cloud box where the Emacs server runs has access to machines that are not directly accessible to you from the machine you're connecting from.

OTOH VS Code likely can be run in a similar setup.

In general I very much like the modularization of IDEs: instead of a monolith form 1990s you can mix and match your favorite editor with language servers, REPLs, build servers, etc, all separate and in many cases running remotely.

Distributions

Emacs Modified

"Emacs Modified for macOS and Emacs Modified for Windows are distributions of GNU Emacs bundled with a few select packages for LaTeX users and R developers, most notably AUCTeX and ESS."

Portacle

HN link on Portacle comment

Do you know if installing Portacle will mess with any existing configurations of those things on Linux? In particular Emacs. I have everything backed up but, since I only plan to play with CL, I don't want the headache if it does.

Shinmera on Mar 15, 2018 [-]

It should not touch anything outside of its own directory. If it does, then that's a bug and needs to be fixed.

vindarel on Mar 15, 2018 [-]

test in peace, it doesn't interfere with your emacs config or anything else :)

phoe-krk on Mar 15, 2018 [-]

No, it won't. Portacle is 100% self-contained and does not modify anything outside its home directory.

Screenshot - hn comment

General Settings

Location for Settings

  • ~/.emacs.d emacs directory
  • ~/.emacs.d/init.el emacs initialisation file (config file)

Note on Environment Variables

(From the Emacs from scratch post)

Optional: Problem with environment variables

If you got problem with environment variables or commands, for example, Emacs could not recognize brew or something, you might need to load your .bashrc or .bash_profile manually:

    (let ((path (shell-command-to-string ". ~/.bashrc; echo -n $PATH")))
      (setenv "PATH" path)
      (setq exec-path 
            (append
             (split-string-and-unquote path ":")
             exec-path)))

Set Default Directory

StackOverflow post

(setq default-directory "C:/Documents and Settings/USER NAME/Desktop/" )

Auto-insert Closing Bracket

(electric-pair-mode 1)

Note on Syntax Highlighting

In Emacs, syntax highlighting is performed using the module font-lock. It highlights a buffer in two phases:

  • The syntactic phase, where comments and strings are highlighted.
  • The keyword phase, where everything else is highlighted. Link - StackOverflow Comment

Themes

Theme directories

Themes I have installed:

Solarized

Others

Tools for Themes

Emacs Gen

Syntax Highlighting (Font Lock)

Emacs KeyBindings

Dired

TUTORIAL - WDired -> Writeable dired

Ido, Ivy, Helm

Filestash

With your data spread over to many different places, vendors and clouds, Filestash unify it all from one single web application.