windowsvimlatinnon-latin

Vim – document navigation don't work on cyryllic texts in Windows but works in Linux


Good morning!

Recently I installed gvim on windows 10 and started vimtutor. My home language is Russian and vimtutor was translated by default.

After entering lesson 2.1 I found out that I can't use dw to delete words. Using this command I can delete 1 or sometimes 2 letters in a word. I can't delete the whole word as vimtutor says. Example of text from vimtutor:

Несколько слов рафинад в этом предложении автокран излишни.

For testing purposes I inserted some text using latin symbols and tested dw. Everything deletes correctly.

So when I use gvim in windows 10 I can't complete vimtutor because it works incorrect with non-latin characters. I found a similar question here Similar question The answer was "don't use cyrillic characters". Unfortunately, the answering person didn't fully understood the problem. The question was about editing non-latin text and the answer was about using non-latin symbols in command mode (which is not a problem for me).

I continued my research and found out that console version of vim in windows 10 has the same problem: I can't edit texts with cyrillic symbols.

Then I loaded my OpenSUSE i3 system and launched vimtutor there. Suddenly, all commands work correctly and I can complete vimtutor (even if it mostly contains cyrillic characters).

Do I miss some setup steps in Windows or is it a bug? Why dw don't work only on non-latin words and only in Windows?


Solution

  • After creating issue on Github (https://github.com/vim/vim/issues/8588) I got a respond from habamax about the problem. It seems that in old versions of Windows vim utf-8 is not used by default. Editing vimrc or using nightly build (as habamax suggested in the issue) solves the problem.