.vimrc contains previous mappings

I've changed my .vimrc file, and when I do so, and re-source the file, I've noticed that the vim emulator will honour mappings that I've removed from the file.

Meaning, if I have the following in my .vimrc:

nnoremap K M

Which I then source, and use, then I want to update this to be:

nnoremap W M

and source the file, both, 'K' and 'W' will now perform 'M' even though I've only got 'W' mapped to 'M'.

If anyone knows what I'm doing wrong, do let me know as its driving me insane. 

0
2 comments

This is a pretty correct behaviour of the `source` command. Since your `.vimrc` doesn't contain an `unmap` command for `K`, your configuration is executed again and you get two mappings to `M`.

0

Hi,

Thanks for your reply. I didn't know that the command worked like that.

0

Please sign in to leave a comment.