diff --git a/plugins/tilde-switch/README.md b/plugins/tilde-switch/README.md new file mode 100644 index 000000000..08f31fcff --- /dev/null +++ b/plugins/tilde-switch/README.md @@ -0,0 +1,9 @@ +# tilde-switch plugin + +By default, on some non-US keyboards of Macbooks like Swedish and Turkish, tilde key switched with a plus-minus key. So this plugin switches back the `±` key to `~` without needing any third-party tool or service. + +To use it, add `tilde-switch` to the plugins array of your `.zshrc` file: +``` +plugins=(... tilde-switch) +``` + diff --git a/plugins/tilde-switch/tilde-switch.plugin.zsh b/plugins/tilde-switch/tilde-switch.plugin.zsh new file mode 100644 index 000000000..60587877b --- /dev/null +++ b/plugins/tilde-switch/tilde-switch.plugin.zsh @@ -0,0 +1,39 @@ +#!/usr/bin/env zsh + +# +# tilde-switch-zsh +# +# This key binding plugin gets tilde key back on MacOS +# Swithes back ± key to ~ +# +# Copyright(c) 2021 Mevlut Canvar +# MIT Licensed +# + +# +# Mevlüt Canvar +# GitHub: https://github.com/mcanvar +# Twitter: https://twitter.com/mevlutcanvar +# + +# +# This solution taken from here: https://apple.stackexchange.com/a/353941 +# + +MAPPING=$(cat < /dev/null