Giter Site home page Giter Site logo

Comments (8)

lyokha avatar lyokha commented on May 24, 2024

How do you expect it to work? Keymap assistance won't switch system keyboard layout. Instead, it relies on builtin Vim's iminsert and imsearch attributes. So, when you returned from Insert mode with, say, Russian keyboard layout, typing fg will actually find letter п. I use dynamic keymap assistance with the following config:

let g:XkbSwitchAssistNKeymap = 1    " for commands r and f
let g:XkbSwitchDynamicKeymap = 1
let g:XkbSwitchKeymapNames =
            \ {'ru' : 'russian-jcukenwin', 'de' : 'german-qwertz'}
" quickly toggle keyboard layout for f and r commands in normal mode
" (<C-^> also switches keyboard layout in search mode)
let g:XkbSwitchIminsertToggleKey = '<C-^>'
let g:XkbSwitchIminsertToggleEcho = 0

It works for me. Notice that there is mapping <C-^> for switching Keymap assistance related keyboard layout in Normal mode. Note that dynamic assistance requires setting of g:XkbSwitchKeymapNames. I also checked the simple (static) config you showed, and it worked as well.

As to XkbSwitchAssistSKeymap, it is not actually working any more (and therefore is deprecated), because now search in the command line obeys the normal keyboard layout switching flow which unites the search mode with the Insert and Select modes.

from vim-xkbswitch.

mario-amazing avatar mario-amazing commented on May 24, 2024

IMHO expected behaiviour the same as you described above. But when I press fg(with previous Russian language), vim tried to find g letter.
I have tried your proposal with lua config, but have the same result:

-- vim-xkbswitch
vim.g.XkbSwitchLib = '/usr/local/bin/libxkbswitch.dylib'
vim.g.XkbSwitchEnabled = 1
vim.g.XkbSwitchIMappings = { 'ru' }
vim.g.XkbSwitchAssistNKeymap = 1    -- for commands r and f
vim.g.XkbSwitchDynamicKeymap = 1
vim.g.XkbSwitchKeymapNames = {['ru'] = 'russian-jcukenwin', ['uk'] = 'ukrainian-jcuken'}
vim.g.XkbSwitchIminsertToggleEcho = 0

from vim-xkbswitch.

lyokha avatar lyokha commented on May 24, 2024

After you return from Insert mode with Russian layout to Normal mode, what command

:echo b:xkb_layout

says? Does it say ru?

from vim-xkbswitch.

mario-amazing avatar mario-amazing commented on May 24, 2024

E121: Undefined variable: b:xkb_layout

from vim-xkbswitch.

lyokha avatar lyokha commented on May 24, 2024

I made a typo, I meant b:xkb_ilayout

from vim-xkbswitch.

mario-amazing avatar mario-amazing commented on May 24, 2024

:echo b:xkb_ilayout: 1
when English 3

from vim-xkbswitch.

lyokha avatar lyokha commented on May 24, 2024

Values 1 and 3 are rather weird: they are keyboard layout names and therefore should normally be like us and ru. But if you really have such names, then use dynamic keymap assistance with

let g:XkbSwitchKeymapNames = {'1' : 'russian-jcukenwin'}

from vim-xkbswitch.

mario-amazing avatar mario-amazing commented on May 24, 2024

Still the same behavior

from vim-xkbswitch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.