MacOS iterm2 + zsh cursor movement

Bryan Lee·2020년 9월 2일
0
  • MacOS 기본 터미널 bash command-line
    • ⌥ + ← 또는 ⌥ + → : 커서를 왼쪽 단어 또는 오른쪽 단어로
    • ⌘ + ← 또는 ⌘ + → : 커서를 start 또는 end of line 으로
  • zsh 의 경우
    • ESC B 또는 ESC F : 커서를 왼쪽 또는 오른쪽 단어로 이동(불편하기 짝이 없음)
    • ⌃ + a 또는 ⌃ + e : 커서를 start 또는 end of line 으로

  • zsh에서 macos bash 기본터미널 커서 움직임과 동일하게 설정하는 방법
  1. .zshrc에 아래 line 들 추가
  bindkey "[D" backward-word
  bindkey "[C" forward-word
  bindkey "^[a" beginning-of-line
  bindkey "^[e" end-of-line
  1. iterm2의 preferences > Keys > Key Bindings
    ⌘ + ← > Action: Send Escape Sequence 에 a 입력 > OK
    ⌘ + → > Action: Send Escape Sequence 에 e 입력 > OK

0개의 댓글