[vim] Cursor Shape 에러 / 변경

boychaboy·2023년 6월 14일

no vim, no code

목록 보기
1/2

vim + iterm2를 사용하다 보면 커서 모양이 가끔 원하는대로 되지 않을 때가 있다. 아니면 평소에는 잘 바뀌는데 tmux로 접속하면 커서 모양이 바뀌지 않을때가 있다. 이럴 때 해결하는 방법을 소개한다.

아래 명령을 ~/.vimrc에 추가한다.

" cursor shape
" Options (replace the number after '\e[')
"    Ps = 0  -> blinking block.
"    Ps = 1  -> blinking block (default).
"    Ps = 2  -> steady block.
"    Ps = 3  -> blinking underline.
"    Ps = 4  -> steady underline.
"    Ps = 5  -> blinking bar (xterm).
"    Ps = 6  -> steady bar (xterm).
let &t_SI = "\e[5 q" " insert mode
let &t_EI = "\e[1 q" " normal mode
  • 간혹 소개하는 방법 중에 if exists($tmux) ... 이런식으로 조건문 걸어서 ~./vimrc에 추가하라는 내용이 있는데 macOS에서는 잘 되지 않았다.

Ref.

profile
no vim no code

0개의 댓글