0.0.7 • Published 2 years ago

coc-mozc v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

release test

coc-mozc

NeoVim の日本語入力を Mozc で出来るようにするプラグインです。 COC のサジェストのリストに表示されるようになります。

Mozc input method source for coc.nvim

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

  • 部分確定できない
    • カーソル移動をトリガーとして、部分的に確定したい
  • c-h で戻った時に、今度は部分的に確定されてしまう
  • ユーザーが下記のキーに何かしらのショートカットを設定している場合、切り替えの時点で奪ってしまう
    • CR
    • SPACE
  • SPACE で候補選択するようになっているので、ローマ字として入力を確定させる方法が欲しい
    • 例えば、 Vim は と打とうとするとしんどい
    • F10 とかを実装すれば大丈夫そう
  • Fcitx などの挙動に近づけるために、 SPACE で一個目の予測を選択、 CR でひらがなとして入力、としているが、やや分かりにくい
    • 特に英語と日本語の混じった文章を書く時に辛い
    • 入力中にひらがなとして表示されている状態が望ましい
    • SPACE や C-N は、最初の一回だけ 2 つ下に移動して欲しい
    • 大文字入力した時に候補が出なくて改行してしまうミスも引き起こす

上記の問題はありつつ、まあ一旦動くから良しとしている。コーディング中にさくっと日本語入れたい時の補助だったら問題なさそう ← だったら最初から(ry

Inspired By

License

MIT


This extension is built with create-coc-extension

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago