GVim how to disable hiragana default input

I installed gVim7.4 on a Japanese Windows 7 computer. I have a problem: when I press "i" to switch to input mode, I get an automatic and unwanted transition from romaji to hiragana insert. Therefore, each time I manually press the ひ ら が な key to switch to romaji mode. Otherwise, I would write in hiragana and kanji. Similarly, when I press "/" to perform a search, it again automatically switches from romaji to hiragana. Do you know a way to install gVim with insert romaji text by default? How could I avoid these automatic switches in hiragana mode?

+4
source share
1 answer

To change the default IME behavior in Vim, insert the ~ / .vimrc file

set iminsert=0 
set imsearch=-1 

Using -1for imsearchlocks the search key card in the same way as insert mode.

You can enable and disable the IME parameter with <ctrl>+^. To automatically disable Japanese IME when exiting insert mode, you can use

inoremap <ESC> <ESC>:set iminsert=0<CR>

More about these

:h iminsert
:h imsearch
:h i_CTRL-^

Addition: It may be convenient to change the color of your cursor depending on the IME settings.

if has('multi_byte_ime')
    highlight Cursor guifg=NONE guibg=Green
    highlight CursorIM guifg=NONE guibg=Purple
endif

I found him in

:h CursorIM
+5
source

Source: https://habr.com/ru/post/1606513/


All Articles