obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

Can't map the Tab key w/o Mod Keys

Open kvietcong opened this issue 4 years ago • 4 comments

Hi, I'm trying to map fold toggling to the tab key in normal mode but it seems that it isn't working. However, when I add a mod key (alt, ctrl, shift, etc) it works. Here is what I have

exmap toggleFold :obcommand editor:toggle-fold
map <Tab> :toggleFold
nmap <Tab> :toggleFold
nmap <S-Tab> :toggleFold
nmap <C-Tab> :toggleFold

I have tried unmapping tab but that doesn't work either

I would appreciate any help

kvietcong avatar Sep 16 '21 03:09 kvietcong

I can't seem to get just <Tab> remapped either. This is likely a bug with CodeMirror unfortunately.

Andr3wD avatar Sep 23 '21 19:09 Andr3wD

I see, thanks for checking the issue out. Should I close this then?

kvietcong avatar Sep 25 '21 20:09 kvietcong

Unfortunately, probably yeah. There's a chance a workaround can be added, but I don't know if anyone really wants to deal with intercepting any keys, if that's even possible. At that point, a standalone vim plugin might as well be made. I could be missing something though, so maybe leave the issue open for a bit longer in case anyone else knows a solution.

Andr3wD avatar Sep 28 '21 18:09 Andr3wD

In the CodeMirror Vim demo mapping Tab works, so I assume that Obsidian catches that key and doesn't pass it to CodeMirror. It should be possible to intervene with that, I'll mark it as a feature request.

esm7 avatar Sep 29 '21 05:09 esm7