Vim and Cyrillic: a couple of tricks

Previously, for editing ordinary Russian-language texts, I usually put Vim aside and resorted to the help of other editors. The reason for this was a couple of very unpleasant stocks:
- For every sneeze, you had to switch the layout a hundred times to correctly enter a couple of commands and return back. For example, replacing a typo letter in a newly written word, poured into: switch → get to the letter, press r → switch → [desired letter] → switch → A → [write further]. Hell!
- The regular spell checker did not like the letter “ё” and proposed to replace any word with its participation with an analogue through “e”. And I love you, it upset me.
And finally, I found a solution to both problems. I'm sitting now and typing this text in Vim. It is curious that both barriers are dispensed with regular means, without additional plug-ins. Since there are much more materials in English and based on them than primordially Russian, it was not easy for me to find this information. Therefore, I want to share it with those who are interested.
Layout Switching
Many times I came across a proposal to remap Cyrillic characters into Latin letters like this: I did not like this solution because it left several problems. For example, punctuation cannot be re-mapped, so the colon and slash in the Russian layout in any case move to new places. Also, in insert mode, you cannot use combinations like Ctrl + W or Ctrl + R. All this annoyed. We need a different solution and it was found! In .vimrc: Now clarifications. Vim has such a thing as lmap. It sets the conversion for all cases when it comes to entering characters as part of the text, but not as part of the command. So lmap is taken into account when inserting, entering a search pattern, after the r and f commands.
map й q
map ц w
map у e
map к r
map е t
map н y
" ... и т.д.
set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan
The command "set keymap = russian-jcukenwin" sets up a bunch of lmap that correspond to a regular Windows yutsuken keyboard. russian-jcukenwin is just a file name with mappings. We already have the required one in the standard delivery.
After installing keymap, you can switch between Cyrillic and Latin by pressing Ctrl + ^. At the same time, what happened was achieved: teams and shortcuts do not suffer in any way with the active Russian layout. Hurrah!
Resetting iminsert and imsearch is necessary so that the very first time the insertion and input of the search pattern begins in Latin. Essentially, Ctrl + ^ toggles these values between 0 and 1.
The last line changes the cursor to blue when the alternate layout is on. That is, Cyrillic in our case. Very comfortably.
Letter y
I also did not like the suggestions not to be clever and type through "e" or add words through "ё" in the dictionary of additions in the course of work. A different solution was needed and it was under your feet! ... instead of being promoted everywhere ... asks Vim to use a dictionary with words through "ё". And this is exactly what you need. After this command] s and [s no longer stumble over each ё. That's it, now the rest of the editors are not needed. Thanks to all. I hope you find it helpful.
:setlocal spell spelllang=ru_yo,en_us
:setlocal spell spelllang=ru_ru,en_us