Jemsu Quartz

Search

Search IconIcon to open search

Fixing file associations on macOS

Last updated Apr 1, 2023 Edit Source

When you try to open a small YAML file and nothing happens, only to realize that the behemoth that is Xcode has been starting up for what feels like minutes — that’s when it’s time to recheck file type associations on your machine.

duti is a neat and ancient little tool for that. It’s unsupported and I wouldn’t rely on it in the long run, but as long as it still works, it works.

# Checking associations

1
2
3
4
5
6
7
8
9
❯ duti -x yaml
Zed.app
/Applications/Zed.app
dev.zed.Zed

❯ duti -x sh
Xcode.app
/Applications/Xcode.app
com.apple.dt.Xcode

# Fixing associations

1
2
3
4
duti -s com.microsoft.VSCode sh all
duti -s com.microsoft.VSCode bash all
duti -s com.microsoft.VSCode zsh all
duti -s com.microsoft.VSCode yml all

Useful identifiers: