hluk / FakeVim

Vim emulation in QTextEdit, QPlainTextEdit and similar Qt widgets
GNU Lesser General Public License v2.1
173 stars 30 forks source link

:map j gj gives "Recursive mapping" error #39

Open rexkerr opened 7 years ago

rexkerr commented 7 years ago

My .vimrc is shared with my actual vim installation. I have the following mappings, which lead to errors:

map j gj
map k gk

This works fine in real vim, but gives a Recursive Mapping error in FakeVim.

hluk commented 7 years ago

I wonder why it doesn't give an error in Vim (:help recursive_mapping seems to suggest that map j gj should give an error).

I don't know how to fix this. It should be safe to use noremap j gj.

TruncatedDinoSour commented 2 years ago

Here's a example from my vim config, could apply to you too:

for context in ['n', 'v']
    let ccontext = context . 'noremap'

    exec ccontext 'h b'
    exec ccontext 'l w'
    exec ccontext 'b h'
    exec ccontext 'w l'
endfor
TruncatedDinoSour commented 2 years ago

Here's a example from my vim config, could apply to you too:

for context in ['n', 'v']
    let ccontext = context . 'noremap'

    exec ccontext 'h b'
    exec ccontext 'l w'
    exec ccontext 'b h'
    exec ccontext 'w l'
endfor

It's quite stupid, I should have done some more digging when I did this I found something here: https://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping

noremap h b
noremap l w
noremap b h
noremap w l