G
G
Grafnet2021-07-21 19:27:03
vim
Grafnet, 2021-07-21 19:27:03

How to correctly switch layout in Vim using vim-xkbswitch?

I am learning vim. The first problem I encountered was the need to constantly switch to the English layout when switching to command mode in the process while working with text in Russian.

There is a vim-xkbswitch plugin that is designed to solve this problem: when switching to command mode, the layout is automatically switched to English, and when switching to insert mode, the previous layout is returned.

But the fact is that for some reason it is not possible to make vim-xkbswitch work on Windows.

.vimrc:

call plug#begin()
Plug 'lyokha/vim-xkbswitch' 
Plug 'scrooloose/nerdtree' , { 'on':  'NERDTreeToggle' } 
call plug#end()

let g:XkbSwitchLib = 'C:\path\to\libxkbswitch64.dll'
let g:XkbSwitchEnabled = 1 
let g:XkbSwitchIMappings = ['ru']


I get:
Error detected while processing BufEnter Autocommands for "*"..function 9_xkb_switch:
line 7:
E364: Library call failed for "Xkb_Switch_getXkbLayout()"


I tried it on different systems with Windows 10, added optional variables from the instructions to xkb-switch, launched Vim from different consoles, changed the path to libxkbswitch64.dll - to no avail.

It is not clear where the error lies and whether vim-xkbswitch works at all on Windows 10. Searching the contents of error E364 does not return any results.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question