Comments (30)
This is already in as you described. How do you switch modes?
from vim-xkbswitch.
I use gvim under windows.
I select text with cursor keys and SHIFT pressed. Vim automatically
switch to SELECT mode.
On 31.07.2014 12:03, Alexey Radkov wrote:
This is already in as you described. How do you switch modes?
—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
As you can see at screen cast:
- after i select text, i switch layout to RU and start typing;
- first character entered in RU layout, as expected;
- but all others entered in EN, because vim automatically switch layout to EN;
from vim-xkbswitch.
Yes, i remember that problem and it is reproducible. I will try to fix it but i remember that it is hard because when you just entered Select mode and then switched layout without typing text there is no hook in vim to catch this event because there is no SelectEnter (like existing InsertEnter).
from vim-xkbswitch.
Why do not simply logically combine SELECT and INSERT modes and don't try to switch layouts between them?
I understand, you capture current layout using using vim events, and select mode doesn't generate any needed events.
from vim-xkbswitch.
I do combine Select and Insert mode: they work as a whole. For example enter Insert mode, change layout to Russian, exit it and enter Select mode, then start typing: you will get Russian and vice versa works too: this bug just proves this! It switches layout to which was set on the second character typed! What you see is vim's discrepancy about Select mode to Insert mode transfer. Actually when the first character is inserted in Select mode we are still in some Mode-Limbo: this is nor Insert mode yet neither Select mode.
from vim-xkbswitch.
So, there is no way to detect layout switching in select mode?
On 31.07.2014 13:25, Alexey Radkov wrote:
I do combine Select and Insert mode: they work as a whole. For example
enter Insert mode, change layout to Russian, exit it and enter Select
mode, then start typing: you will get Russian and vice versa works
too: this bug just proves this! It switches layout to which was set on
the second character typed! What you see is vim's discrepancy about
Select mode to Insert mode transfer. Actually when the first character
is inserted in Select mode we are still in some Mode-Limbo: this is
nor Insert mode yet neither Select mode.—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
Did you set g:XkbSwitchLoadOnBufRead im .vimrc?
from vim-xkbswitch.
No.
Does this option can help?
from vim-xkbswitch.
No. If you would have set it to 0 then it could explain such behaviour in very rare cases.
What says your
:echo &selectmode
and
:smap <LeftRelease>
? Second command must output someting with command xkb_switch(1, 1).
from vim-xkbswitch.
Ok, i see what the reason of the problem is. You are using selectmode=key
. It is not currently supported in the plugin, only selectmode=
and selectmode=mouse
(start Select mode by mouse) are supported. I will think about fixing it as an enhancement.
from vim-xkbswitch.
Please try the fix: should work
from vim-xkbswitch.
No, the behavior wasn't changed.
from vim-xkbswitch.
What is your selectmode
and keymodel
options? What shows command
:nmap <S-Right>
?
from vim-xkbswitch.
n *@call 54_xkb_switch(1,1)
On 31.07.2014 17:14, Alexey Radkov wrote:
nmap
from vim-xkbswitch.
Correct. Shift-Right must work. Do you use Shift-Right? Or other keystrokes?
from vim-xkbswitch.
Exactly S-Right.
On 31.07.2014 17:31, Alexey Radkov wrote:
Correct. Shift-Right must work. Do you use Shift-Right? Or other
keystrokes?—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
I am using vim on Linux. The behaviour before the fix was the same as you described. After the fix it behaves well. Unfortunately i cannot test it on Windows.
from vim-xkbswitch.
Later i can look at your fix and try to adopt it for windows, if it
possible.
On 31.07.2014 17:39, Alexey Radkov wrote:
I am using vim on Linux. The behaviour before the fix was the same as
you described. After the fix it behaves well. Unfortunately i cannot
test it on Windows.—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
Ok, but i really can't get the reason of difference between Linux and Windows implementations, except Windows one has 'local' setting (i.e. layout switching affect only current window whereas Linux implementation is 'global'), but this should not affect here and i tried to switch this setting to 'local' to test it and it worked too.
from vim-xkbswitch.
Ah, did you start Select mode from Normal or Insert mode?
from vim-xkbswitch.
If I start select from NORMAL mode - it works, from INSERT - no.
On 31.07.2014 17:55, Alexey Radkov wrote:
Ah, did you start Select mode from Normal or Insert mode?
—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
It works as expected if I enter SELECT mode from NORMAL mode.
But old invalid behavior remaining if I enter SELECT mode from INSERT mode.
from vim-xkbswitch.
Try this fix, should work for selections in Insert mode. Btw you may notice fast unnecessary switching of layouts when doing selections from Insert modes: see comments in the patch for details why it happens.
from vim-xkbswitch.
Yes, now works as it should.
Thank you.
from vim-xkbswitch.
One thing.
You intercept S+Arrow key to detect entering in SELECT mode?
This not works if I select text with Ctrl + Shift + Left, for example.
Maybe more common approach needed to detect SELECT mode?
from vim-xkbswitch.
As i see, only S+Right and S + Down works,
Also needed to hook S + Left and S + Up combinations.
from vim-xkbswitch.
Do not work for specific key combinations? This is extremely strange because the plugin does not distinguish between them, instead it just creates mappings for each S-key element from a list. Maybe some desktop level key-bindings driven issue?
Btw in latest commit I introduced a new variable g:XkbSwitchSelectmodeKeys
where you can put custom Select mode start key bindings (but i do not believe that such customization may be of any use). Default value is
let g:XkbSwitchSelectmodeKeys =
\ ['<S-Left>', '<S-Right>', '<S-Up>', '<S-Down>', '<S-End>',
\ '<S-Home>', '<S-PageUp>', '<S-PageDown>']
from vim-xkbswitch.
Please try Shift-Ctrl keys: must work now. If everything is Ok then i'll close the issue.
from vim-xkbswitch.
Seems everything fine.
Thanks.
On 01.08.2014 22:06, Alexey Radkov wrote:
Please try Shift-Ctrl keys: must work now. If everything is Ok then
i'll close the issue.—
Reply to this email directly or view it on GitHub
#12 (comment).
from vim-xkbswitch.
Related Issues (20)
- Смена расскладки при r{char} HOT 1
- Не удается заставить работать на ubuntu 18.04 HOT 25
- 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
- Keymap assistance in Normal mode not working HOT 8
- Не удается заставить работать на Ubuntu 22.10 HOT 5
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.