VS Code Commit 中文名乱码

Mac 和 Linux 里使用 VS Code,commit 到 Github 时,commit 里文件名的中文显示乱码,查了一下,设置 core.quetepath 应该就可以:

git config --global core.quotepath false

Linux switch some key to make keyboard work like Mac

System → Preferences → Keyboard Shortcuts → Custom

Ctrl + C/ Ctrl + V/ Ctrl + X/Ctrl + A, Change Ctrl to Alt
xte "keyup Alt_L" "keyup Alt_R" "keyup c" "keydown Control_L" "key c" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup v" "keydown Control_L" "key v" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup x" "keydown Control_L" "key x" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup a" "keydown Control_L" "key a" "keyup Control_L"

In Chrome, Ctrl + T/ Ctrl + W/ Ctrl + R/Ctrl + L, Change Ctrl to Alt
xte "keyup Alt_L" "keyup Alt_R" "keyup t" "keydown Control_L" "key t" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup w" "keydown Control_L" "key w" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup r" "keydown Control_L" "key r" "keyup Control_L"
xte "keyup Alt_L" "keyup Alt_R" "keyup l" "keydown Control_L" "key l" "keyup Control_L"

System → Preferences → Keyboard Shortcuts → Typing

Switch language input from Meta + space to Ctrl + space


pair Airpods with Debian Linux

If you can't pair Airpods 2 with Debian 12, try this:

1. install some software: pulseaudio, pulseaudio, bluez

2. run in terminal:

bluetoothctl

scan on

find your Airpods Mac Address.

3. pair

in bluetoothctl, type: pair <MAC address>

if neet PIN, The default PIN for AirPods is 0000.

英文版 Debian 安装 ibus-libpinyin

安装拼音输入法
apt-get install ibus-libpinyin

设置中文 locales
dpkg-reconfigure locales

然后到 Keyboard 里看看,应该有 Chinese 选项了。在退出重新登录后,Win + Space 应该就可以切换输入法了。

Ubuntu 里的中文输入法

给一台 2015 年的 Macbook Air 装上了 Ubuntu,本来想偶尔没带电脑时可以顶一下,不过确实键盘太难用,以及有点慢,想玩 Linux,还是回头再去正经买一台电脑好了。

Ubuntu 我装的是英文版,所以装完后还需要简单设置中文输入法:

  • System Tools - Language Support 安装简体中文
  • sudo apt-get install ibus-googlepinyin
  • ibus-setup 和 Region & Language 里设置

基本就可以了。就用来上网、写字的话,再装几个软件就差不多了,比如:

  • Chrome
  • VSCode

English auto complete on Mac

今天才知道,原来 Mac 上输入英文,也可以有“自动完成”功能。

输入单词的前半部分,然后按快捷键 Option + Esc,就能呼出可能的单词列表了。

有可能需要在设置 - Keyboard - Text input 里打开 Show inline predictive text。