Updated: 2022-01-19 02:15:03 CST +08

macOS

Keyboard Shortcut

iTerm 2

Use ⌥ ← and ⌥ → to jump forwards / backwards words

Use ⌥ ← and ⌥→ to jump forwards / backwards words in iTerm 2, on OS X@coderwall

  1. set left ⌥ key to act as an escape character
    1. iterm2 > preferences > profile > keys
    2. left ⌥ key > Esc+
  2. set ⌥← to jump backwards
    1. Keyboard Shortcut: ⌥←
    2. Action: Send Escape Sequence
    3. Esc+: b
  3. ⌥ → as well

Key Repeat

Mac OS hold key down is show special char default, to change to repeat input char.

  • Enable Key Repeat
  defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
  • Disable Key Repeat
  defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true
  • Restart your computer

  • Adjust key repeat speed

    1. System Preferences
    2. Keyboard
    3. Key Repeat
    4. Delay Until Repeat

Chinese Input

  • McBopomofo: for Old Style Chinese Input like 「ㄅ半」

Path

  1. change dir to paths.d
   /etc/paths.d/
  1. add path file, name “go”
   #go
   /usr/local/go/bin
  1. save file, and restart terminal

System Limit

Kernel

  • View
  $sudo sysctl -a
  • Adjust
  $sudo sysctl -w kern.maxfiles=1048600
  $sudo sysctl -w kern.maxfilesperproc=1048576

Open Files Limit

  • Check ulimit
  ulimit -n

Session

  • Adjust ulimit
  ulimit -S -n 1048576

System Wide

  • Temporarily
  $sudo sysctl -w fs.file-max=1048576
  • Persist
    • Add fs.file-max=1048576 in /etc/sysctl.conf

User Level

  • Edit /etc/security/limits.conf
  <domain>    <type>  <item>  <value>
  dinolai     hard    nofile  4096
  dinolai     soft    nofile  1024