diff --git a/README.md b/README.md index 62261bed..4f2ae0ef 100644 --- a/README.md +++ b/README.md @@ -547,6 +547,15 @@ bindkey -v zinit light olets/zsh-abbr ``` +## macOS System Text Substitutions + +The following snippet will make your global macOS text substitutions available in the shell. + +```shell +for substitution in ${(f)"$(defaults read ~/Library/Preferences/.GlobalPreferences.plist NSUserDictionaryReplacementItems | plutil -convert json -o - - | jq -r 'to_entries[] | "\(.value.replace)=\(.value.with)"')"}; do + abbr add [options] "$substitution" +done +``` ## Performance Snapshot with macOS 10.15 on early-2015 MacBook Pro (2.9 GHz Intel Core i5, 16 GB 1867 MHz DDR3), zsh 5.8, zinit 3.1, iTerm2 3.3.12. Profiled with `zprof`.