All notes tagged with macos.

July 1, 2024

emacs macos

Install Emacs on the Mac - Part Two

Previously, I used to install Emacs on the Mac through a build script, but I recently switched to the Emacs Plus version, installed through homebrew.

First, you need to “tap” it and install dependencies before you can use it:

brew tap d12frosted/emacs-plus

# Install dependencies
brew install jq

And then you can install it. I pin it to a version and use minimal flags:

brew install emacs-plus@30 --with-memeplex-slim-icon --with-native-comp

And there you go, an Emacs version specifically tuned for the Mac.

June 30, 2024

emacs macos

Enhancing Font Rendering in Emacs on macOS

Recently, I stumbled upon a Reddit thread on font rendering in Emacs on macOS. I figured many users might be unaware of simple trick for crisper fonts:

defaults write org.gnu.Emacs AppleFontSmoothing -int 0

After running this command, restart Emacs to see the effect.

If you’re not satisfied with the result, you can easily revert to the default settings by running:

defaults delete org.gnu.Emacs AppleFontSmoothing

Remember to restart Emacs after making changes again.

Switching between devices with Syncthing

I have a desktop machine running Linux and a Macbook running MacOS, and I often switch between devices while working on a project.

Now, I can sync states using Git, but I often find that doing so makes me create pointless commits just to sync states.

That’s where I started using Syncthing on all my devices. I’ll leave installing Syncthing for you, the reader, but there is one handy trick I think you need to know.

If you create a .stignore file in your project root, and you add:

#include .gitignore

It will take your .gitnore and exclude the items in it from being synced. This is helpful for reducing the size of the sync but also means that you won’t sync build artifacts, which may not be compatible across devices.

Try it out!

December 10, 2023

clojure macos lisp

Clojure on MacOS

To install the latest version of Clojure on MacOS, you first need to install Java, after which you can install Clojure.

To install Java, I use Temurin and pick the latest LTS (Long-Term Support) version.

Assuming you already have Homebrew:

brew install temurin
brew install clojure/tools/clojure

This will also install rlwrap which makes sure that you can use the arrow keys in the REPL.

I also use neil for some common aliases, for example, to create a new project.

brew install babashka/brew/neil

Now you can run the neil new command to create a new Clojure repository.

May 20, 2023

fish macos

Setting up Fish on the Mac

Fish shell is my shell of choice and having it setup as default on the Mac requires some extra steps.

When homebrew is installed, run brew install fish.

After that, edit /etc/shells and add fish to it:

# sudo edit /etc/shells

Add the bottom of the file add:

/opt/homebrew/bin/fish

Then set the shell as default with:

chsh -s /opt/homebrew/bin/fish

It does require logging again to be activated.

February 27, 2023

macos alacritty

Crisp fonts on Alacritty

screenshot of my Alacritty setup on the Mac

I’m using Alacritty on the Mac and I noticed how the font rendering is much thicker than I’m used to on iTerm. On iTerm I use the “thin strokes” setting, which is not available in Alacritty.

Turns out, you can set it with:

defaults write org.alacritty AppleFontSmoothing -int 0

If you then log in and logout again, your Alacritty will be similar to the crispness you find in iTerm.

If you want to restore it back to the default, do:

defaults delete org.alacritty AppleFontSmoothing

And if you like to have this kind of crispness across the entire OS. Do:

defaults write -g AppleFontSmoothing -int 0

February 27, 2023

macos

Faster key repeat on the Mac

I like to have my key repeat set high, because I still browse my code line, by line; yes, I know there are better ways to browse.

On the Mac, if you go through the “System Preferences”, there is only so much you can do. Luckily, you can get the right settings if you use the terminal.

First, make sure that you have disabled “Slow keys” in “System Preferences > Accessibility > Keyboard > Slow keys”.

Then go into your Terminal of choice and type:

defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 12

The normal minimum of KeyRepeat is 2. Setting it to 1 will have a key repeat delay of 15ms.

For the InitialKeyRepeat, the minimum is 10; 15 if you use system settings. I prefer to set it to 12.

If you want to restore the defaults, just go through the system settings and set it to a value you prefer.

October 14, 2022

emacs macos

Install Emacs on the Mac

This note is outdated, I have since switched to Emacs Plus with Homebrew. See here: Install Emacs on the Mac - Part Two.

There are many ways to install Emacs on the Mac, from pre-build Applications, to Homebrew, to installing from source.

My current favorite way to get the latest Emacs which has some additional stuff for the Mac is by using a build script, which builds Emacs from its source.

It’s called build-emacs-macos and is on Github. The instructions to use it are here in the README.