coc-mozc

Mozc input source for coc.nvim

MIT License

Stars
13

coc-mozc

Mozc input method source for coc.nvim. It shows mozc suggestion to COC's completion list.

Why

In terminal, it is hard to input Japanese with OS standard IME. With coc-mozc, you can input Japanese just like code suggestion.

Install

Prerequisite

mozc_emacs_helper is required!

For ubuntu:

sudo apt-get install emacs-mozc

Install coc-mozc via CocInstall

:CocInstall coc-mozc

Example settings

" Selects the first prediction by pressing Enter, meaning insert ひらがな
autocmd User MozcEnabled execute('inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"')
autocmd User MozcDisabled execute('inoremap <cr> <cr>')

" C-j toggles mozc mode
inoremap <expr> <C-j> execute(':CocCommand mozc.toggle')

" Disable mozc when insert leave
au InsertLeave * execute(':CocCommand mozc.disable')

Known Issues & TODO

  • Unable to convert partially
    • Ideally, cursor movement should trigger partial conversion
  • No undo conversion feature
  • SPACE should trigger conversion Kana to Kanji

Inspired By

License

MIT


This extension is built with create-coc-extension

Badges
Extracted from project README
release test