mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Merge 329fae95c1 into 62cf1201b0
This commit is contained in:
commit
5aab60776a
2 changed files with 48 additions and 0 deletions
9
plugins/tilde-switch/README.md
Normal file
9
plugins/tilde-switch/README.md
Normal file
|
|
@ -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)
|
||||||
|
```
|
||||||
|
|
||||||
39
plugins/tilde-switch/tilde-switch.plugin.zsh
Normal file
39
plugins/tilde-switch/tilde-switch.plugin.zsh
Normal file
|
|
@ -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 <mevlutcanvar@gmail.com>
|
||||||
|
# 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 <<EOF
|
||||||
|
{
|
||||||
|
"UserKeyMapping":[
|
||||||
|
{
|
||||||
|
"HIDKeyboardModifierMappingSrc":0x700000035,
|
||||||
|
"HIDKeyboardModifierMappingDst":0x700000064
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"HIDKeyboardModifierMappingSrc":0x700000064,
|
||||||
|
"HIDKeyboardModifierMappingDst":0x700000035
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
hidutil property --set $MAPPING > /dev/null
|
||||||
Loading…
Add table
Add a link
Reference in a new issue