[VIM] make caps as ctrl & esc (#429)

language formatting
This commit is contained in:
莫胜文 2023-04-04 16:16:01 +08:00 committed by GitHub
parent e8154bf526
commit 884e169f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -30,10 +30,11 @@ In order to make it easier to reach these keys, you can remap CapsLock to Esc or
On Windows, [Powertoys](https://learn.microsoft.com/en-us/windows/powertoys/) or [AutoHotkey](https://www.autohotkey.com/) can be used to achieve this goal. On Windows, [Powertoys](https://learn.microsoft.com/en-us/windows/powertoys/) or [AutoHotkey](https://www.autohotkey.com/) can be used to achieve this goal.
On macOS, you can remap keys in system settings, see this [page](https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_macOS). [Karabiner-Elements](https://karabiner-elements.pqrs.org/) also works. On macOS, you can remap keys in system settings, see this [page](https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_macOS). [Karabiner-Elements](https://karabiner-elements.pqrs.org/) also works.
A better solution is to make CapsLock function as Esc and Ctrl simultaneously. Click CapsLock to send Esc, hold CapsLock to use it as Ctrl key. A better solution is to make CapsLock function as Esc and Ctrl simultaneously. Click CapsLock to send Esc, hold CapsLock to use it as Ctrl key. Here's how to do it on different systems:
On Windows, this [AutoHotKey gist](https://gist.github.com/sedm0784/4443120) does just this. - [Windows](https://gist.github.com/sedm0784/4443120)
On macOS, this [karabiner rule](https://ke-complex-modifications.pqrs.org/#caps_lock_tapped_escape_held_left_control) does the magic. - [MacOS](https://ke-complex-modifications.pqrs.org/#caps_lock_tapped_escape_held_left_control)
- [Linux](https://www.jianshu.com/p/6fdc0e0fb266)
## Recommended References ## Recommended References

View File

@ -29,10 +29,11 @@ Vim 的学习资料浩如烟海,但掌握它最好的方式还是将它用在
Windows 系统可以使用 [Powertoys](https://learn.microsoft.com/en-us/windows/powertoys/) 或者 [AutoHotkey](https://www.autohotkey.com/) 重映射键位。 Windows 系统可以使用 [Powertoys](https://learn.microsoft.com/en-us/windows/powertoys/) 或者 [AutoHotkey](https://www.autohotkey.com/) 重映射键位。
MacOS 系统提供了重映射键位的[设置](https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_macOS),另外也可以使用 [Karabiner-Elements](https://karabiner-elements.pqrs.org/) 重映射。 MacOS 系统提供了重映射键位的[设置](https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_macOS),另外也可以使用 [Karabiner-Elements](https://karabiner-elements.pqrs.org/) 重映射。
但更佳的做法是同时将 CapsLock 映射为 Ctrl 和 Esc点按为 Esc按住为 Ctrl。 但更佳的做法是同时将 CapsLock 映射为 Ctrl 和 Esc点按为 Esc按住为 Ctrl。这是不同系统下的实现方法:
Windows 系统下,这个[AutoHotKey gist](https://gist.github.com/sedm0784/4443120) 实现了这个功能。 - [Windows](https://gist.github.com/sedm0784/4443120)
MacOS 可以导入这个[karabiner rule](https://ke-complex-modifications.pqrs.org/#caps_lock_tapped_escape_held_left_control) 重映射。 - [MacOS](https://ke-complex-modifications.pqrs.org/#caps_lock_tapped_escape_held_left_control)
- [Linux](https://www.jianshu.com/p/6fdc0e0fb266)
## 推荐参考资料 ## 推荐参考资料