VIM ESC키 한글 문제 해결 방법(macos)

 mac에서 vim 사용시 normal 모드 자동변환 문제 해결하기

  • 앱 다운로드 : https://github.com/Hammerspoon/hammerspoon/releases/tag/1.0.0
  • 다운로드한 앱을 Application으로 이동 한 후 실행하면 보안관련 설정해주기
  • 'Open Config' 메뉴를 선택한 후 아래 내용으로 변경
  • 다 입력했으면 'Reload Confg' 메뉴 선택
  • 한글로 입력도중 'ESC'키를 누르면 무조건 영어로 변환된다.
-- key mapping for vim
-- Convert input soruce as English and sends 'escape' if inputSource is not English.
-- Sends 'escape' if inputSource is English.
-- key bindding reference --> <https://www.hammerspoon.org/docs/hs.hotkey.html>
local inputEnglish = "com.apple.keylayout.ABC"
local esc_bind

function convert_to_eng_with_esc()
	local inputSource = hs.keycodes.currentSourceID()
	if not (inputSource == inputEnglish) then
		hs.eventtap.keyStroke({}, 'right')
		hs.keycodes.currentSourceID(inputEnglish)
	end
	esc_bind:disable()
	hs.eventtap.keyStroke({}, 'escape')
	esc_bind:enable()
end

esc_bind = hs.hotkey.new({}, 'escape', convert_to_eng_with_esc):enable()

댓글

이 블로그의 인기 게시물

Session 대신 JWT를 사용하는 이유

VSCode에서의 VIM 단축키와 키보드 구매 가이드

우분투에서 테스트링크(testlink)와 맨티스(mantis)로 테스팅 서버 구성하기