Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rexkerr opened this issue Mar 30, 2017 · 3 comments
Open

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

rexkerr opened this issue Mar 30, 2017 · 3 comments

Comments

@rexkerr
Copy link

rexkerr commented Mar 30, 2017

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
Copy link
Owner

hluk commented Apr 1, 2017

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants