All Projects → acro5piano → coc-mozc

acro5piano / coc-mozc

Licence: MIT license
Mozc input source for coc.nvim

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

release test

coc-mozc

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

image image

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].