惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
博客园 - 叶小钗
V
V2EX
博客园 - Franky
博客园_首页
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 【当耐特】
D
Docker
N
Netflix TechBlog - Medium

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Mechanical Keyboard Set up For Mac
2018-10-13 · via jdhao's digital space

Recently I bought a MacBook Pro 2018. While it is a good design overall, its built-in keyboard is not so great AFAIK. So I bought a mechanical keyboard ikbc c87. The mechanical keyboard is designed for the Windows operating systems. I have to make a few tweaks to make my typing experience smooth.

Before we begin#

I have tested the below settings on my MacBook Pro 2018 with the latest Mojave system. For older Mac OS, it probably will work too. But I cannot say for sure.

Switch Win and Alt key#

The Win and Alt keys in the mechanical keyboard correspond to command and option key in the Mac internal keyboard, respectively. But the positions of the two keys are slightly different. In order to make the keyboard work more like Mac internal keyboard, we can use Karabiner-Elements to switch the key mappings of Win and Alt.

After installing Karabiner-Elements, open its preference and choose Simple Modifications. Then, choose your external keyboard as Target Device. Click the Add item button to add one mapping. We need to add four mappings in total, i.e.,

From keyTo key
left_altleft_gui
left_guileft_alt
right_altright_gui
right_guiright_alt

The left_gui and right_gui keys are equal to left_command and right_command.

After this step, you may also consider changing the key caps of Win and Alt to make it clear you have switched the functions of Alt and Win.

Disable internal keyboard when external keyboard is connected#

While using the external keyboard, you may want to disable the internal keyboard temporarily.

First, open Karabiner settings and go to Devices menu. In the bottom section, check the button of external USB keyboard to disable the built-in keyboard when external keyboard is connected.

Make Home and End key behave like Windows#

On Mac, by default, if you press Home and End key, you will go to the beginning and end of current document, which is often not what you expect. We can make the behavior of Home and End key like Windows, i.e., go to the beginning and end of current line.

First, create a folder ~/Library/KeyBindings/ if it does not exist. Then create a file named DefaultKeyBinding.dict and add the following settings into it:

{
  "\UF729"  = moveToBeginningOfLine:; // home
  "\UF72B"  = moveToEndOfLine:; // end
  "$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
  "$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
  "^\UF729" = moveToBeginningOfDocument:; // ctrl-home
  "^\UF72B" = moveToEndOfDocument:; // ctrl-end
  "^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
  "^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}

Rebooting is needed. The change should take effect after system restart.

Now, happy typing!

References#