Comments (5)
Okay, I understand how the problem occurs.
What targets.vim does is at startup as follows:
- Override
a
in both Visual and Operator-pending mode, to provide various features likeaa
,an(
, and so on. - If a key sequence is not known to targets.vim, leave how to act for the key sequence to Vim.
What Arpeggio map sa ...
does is as follows:
- Override
s
anda
in Normal, Visual and Operator-pending mode, to detect which keys are simultaneously pressed. - If
a
(ors
) is not simultaneously pressed with another key, do the default action ofa
(via<Plug>(arpeggio-default:a)
).
The problem is caused by both plugins trying to do "the default action" as a fallback.
When you typed caa
, this key sequence is processed as follows:
c
is typed. It is an operator. Vim waits for another key in Operator-pending mode.a
is typed. It is mapped by vim-arpeggio to detect which keys are simultaneously pressed. Vim waits for another key for a very short time.- Since another key is not typed in the short time limit, vim-arpeggio treats the last
a
is solely typed. Thea
is mapped to<Plug>(arpeggio-default:a)
. <Plug>(arpeggio-default:a)
is mapped totargets#e('o', 'a', 'a')
, because you defined so.targets#e('o', 'a', 'a')
is evaluated. targets.vim requires another key to decide what to do. So Vim waits for another key.a
is typed. targets.vim knows how to handleaa
. So it selects an argument. Operator-pending mode is now complete.c
deletes the argument. Now Vim waits for another key in Insert mode.
But when you typed caw
, this key sequence is processed as follows:
c
is typed. It is an operator. Vim waits for another key in Operator-pending mode.a
is typed. It is mapped by vim-arpeggio to detect which keys are simultaneously pressed. Vim waits for another key for a very short time.- Since another key is not typed in the short time limit, vim-arpeggio treats the last
a
is solely typed. Thea
is mapped to<Plug>(arpeggio-default:a)
. <Plug>(arpeggio-default:a)
is mapped totargets#e('o', 'a', 'a')
, because you defined so.targets#e('o', 'a', 'a')
is evaluated. targets.vim requires another key to decide what to do. So Vim waits for another key.w
is typed. targets.vim doesn't know how to handleaw
. So it leavesaw
to Vim with the following note: "Sinceaw
might be mapped to another key sequence by user,aw
must be remapped if possible".aw
is in the typeahead buffer. Vim reads the first key from there. It isa
. Vim have to remapa
. Anda
is... mapped to the same stuff as (2).- So (2)~(7) are repeated many times.
- Vim detects this remapping loop at some point, then halts the loop.
That's why caw
results in "E223: recursive mapping".
from vim-arpeggio.
Hmm, it seems to be a tricky problem. I’ll look into it later.
from vim-arpeggio.
I've confirmed that the problem is reproducible on my Vim. Both plugins drastically redefines the default key mappings. So the problem seems to be very trickier than I thought. We have to know everything about how targets.vim works to describe the problem.
I'll continue to look into the problem later. But please don't expect too much about solving the problem.
from vim-arpeggio.
Note that both plugins do the right things. The problem is caused by combining both plugins.
vim-arpeggio provides the way to specify whether solely typed key should be remapped or not, but targets.vim doesn't so. The problem could be solved if targets.vim supports this feature. But it seems to be a hard problem.
from vim-arpeggio.
I've ended up finding a solution that should work everywhere, even outside of vim. I love the arpeggio/chord concept and I'm very grateful that you introduced to me via your plugin :)
I don't know why this concept is not more popular, its much better than the modifier keys such as shift or ctrl, it's a more generalized version of them.
I'll build/buy a programmable mechanical keyboard, which has a microcontroller within it, and I can configure it to do arpeggios (and also other cool things, like different functionality if you tap or hold a key)
https://github.com/qmk/qmk_firmware/blob/master/docs/feature_combo.md
I like this one, although its quite expensive:
And there is also a build it your self version (I'm into electronics too)
https://www.reddit.com/r/MechanicalKeyboards/comments/fp9mxs/crkbd/
built with:
https://keyhive.xyz/shop/hotswap-corne-helidox
https://novelkeys.xyz/products/gmk-dots-gb
from vim-arpeggio.
Related Issues (20)
- Unexpected result when running a command included a binding key HOT 2
- chords with mapped keys
- mapping <bar> HOT 15
- Documentation for Vim8 Packages Sourcing Order HOT 1
- Conflict with latex suite (vim-latex) HOT 1
- To distinguish single and multiple modifiers HOT 1
- Is it possible to follow an arpeggio with a simple keybinding or another arpeggio? HOT 2
- leader mapping generates a warning HOT 6
- Unkown function: <SNR>28_chord_key Hardtime compatibility HOT 15
- Arpeggio with capital letter HOT 2
- Having problems with / mapping HOT 2
- Interfering with coc autocompletion HOT 1
- recursive map to another arpeggio sequence? HOT 2
- Cant get to work in NeoVim with installation via VimPlug HOT 2
- Feature: <sequence> option
- :Arpeggiounmap with '|
- Maps with shared keys. HOT 1
- `:Arpeggioinoremap` and `:Arpeggioiunmap` with `<buffer>` freezes vim
- undo joining HOT 3
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-arpeggio.