Comments (8)
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.
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.
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.
E121: Undefined variable: b:xkb_layout
from vim-xkbswitch.
I made a typo, I meant b:xkb_ilayout
from vim-xkbswitch.
:echo b:xkb_ilayout: 1
when English 3
from vim-xkbswitch.
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.
Still the same behavior
from vim-xkbswitch.
Related Issues (20)
- Disable dot (repeat last command) in non-english layouts in normal mode HOT 3
- Cannot switch layout while searching + cannot use shortcuts with modifier keys in insert mode HOT 6
- [question] how to change input method in insert mode? HOT 6
- xkb-switch triggered by neoclide Coc documentation float window HOT 2
- vim-xkbswitch does not remember the layout HOT 1
- Windows 10, gvim/nvim-qt, stopped working - how to debug/diagnose? HOT 3
- Unexpected output to textarea HOT 2
- Появление ошибок во время открытия файла HOT 15
- Switch layout when in normal mode HOT 5
- Sway support HOT 1
- Question. How can I get current layout? HOT 2
- How to use vim-xkbswitch with i3wm? HOT 2
- Bspwm Support HOT 1
- Не находит бинарник xkb-switch HOT 1
- Can't restore Normal mode keyboard layout when leaving search '/' mode HOT 6
- mapping duplicate for script local mapping HOT 10
- Не удается заставить работать на Ubuntu 22.10 HOT 5
- Does not work with lazy.nvim HOT 8
- Doesn't switch language when exiting Insert mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-xkbswitch.