Closed MahdiNazemi closed 1 year ago
Would adding something like
for MOD in ['', 'A', 'S', 'C']
for KEY in "abcdefghijklmnopqrstuvwxyz"
call execute("nnoremap <D" .. MOD .. "-" .. KEY .. "> <nop>")
endfor
endfor
To your init.vim do what you want it to do?
I added the nested loop you shared to my configurations, but the key combinations were not ignored. For example, pressing CMDS did not open the save dialog.
I also modified my question to be more clear that I like these key combinations to be ignored (ignoreKeys
).
Mapping the keys to a <nop>
in NeoVIM won't change the fact that the key is getting passed to Firenvim in the first place. It sounds like you are trying to get those keys handled by the browser outside of Firenvim, no?
I also modified my question to be more clear that I like these key combinations to be ignored (ignoreKeys).
Ah, right, the solution I provided wouldn't work for this. This one should though:
let ignorekeys = []
for MOD in ['', 'A', 'S', 'C']
for KEY in "abcdefghijklmnopqrstuvwxyz"
let ignorekeys += ["<D" .. MOD .. "-" .. KEY .. ">"]
endfor
endfor
let g:firenvim_config = {
\ 'globalSettings': {
\ 'ignoreKeys': {
\ 'all': ignorekeys
\ }
\ }
\}
Note that this doesn't actually ignore all of the bindings you mentionned (e.g. <SACD->
), but nesting for loops or a bit of smarter programming should be able to do that :)
Thank you! Based on your code, I wrote something that is not as clean but gets the job done:
let ignorekeys = []
for KEY in "abcdefghijklmnopqrstuvwxyz0123456789"
let ignorekeys += ["<D-" .. KEY .. ">"]
let ignorekeys += ["<SD-" .. KEY .. ">"]
let ignorekeys += ["<SAD-" .. KEY .. ">"]
let ignorekeys += ["<SACD-" .. KEY .. ">"]
endfor
I added digits 0-9 to KEY
s to allow switching tabs with e.g. CMD1.
Mapping the keys to a
<nop>
in NeoVIM won't change the fact that the key is getting passed to Firenvim in the first place. It sounds like you are trying to get those keys handled by the browser outside of Firenvim, no?
You are right. I should have explained that more clearly in the description of the issue.
What I tried to do
Ignore all key combinations that involve the CMD key, i.e.,
<D->
,<SD->
,<SAD->
, and<SACD->
.What happened
Based on
README.md
, I suspect I have to specify all possible combinations explicitly (underignoreKeys
), but I assume there is an easier way to use a wildcard to specify all possible combinations.