Skip to content

Instantly share code, notes, and snippets.

@jinhwanlazy
Created December 26, 2016 18:04
Show Gist options
  • Save jinhwanlazy/e80e934445d4a2e4a95552b2f2efce5a to your computer and use it in GitHub Desktop.
Save jinhwanlazy/e80e934445d4a2e4a95552b2f2efce5a to your computer and use it in GitHub Desktop.
입력모드에서 빠져나올 때 입력기를 자동으로 영어로 바꿈.
" auto reset input method
function! g:SetImeToEnglish()
let s:current_input_method = system("ibus engine")
if s:current_input_method !~ "xkb:us::eng"
let s:ret = system("ibus engine xkb:us::eng")
endif
endfunction
let s:ibus_version = system("ibus version")
if s:ibus_version =~ "IBus 1.5"
inoremap <silent> <esc> <esc><esc>:<c-u>call g:SetImeToEnglish()<cr>
inoremap <silent> <c-c> <esc><esc>:<c-u>call g:SetImeToEnglish()<cr>
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment