Is there a key map conflict in my Vim?

99 views
Skip to first unread message

Zhe Lee

unread,
Dec 22, 2016, 8:22:45 PM12/22/16
to vim_use
I use the two command below to map my `j` and `k`, the purpose of these command is that when the current line is too long, it will be wrapped in vim window, and you don't want to jump it when you press j or k. So ~
nnoremap <expr> j v:count == 0 ? 'gj' : 'j'
nnoremap <expr> k v:count == 0 ? 'gk' : 'k'

It doesn't work when I enter vim, but it worked when I run the command

`source $MYVIMRC`

I check my vimrc file no key map conflict in it. It means that my plugin get some duplicated key map ?

How to fix it ? I use gvim 8 on windows


Tony Mechelynck

unread,
Dec 23, 2016, 6:36:55 PM12/23/16
to vim...@googlegroups.com
After entering Vim, at a point where the mapping "doesn't work", type

:verbose map j
:verbose map k

If it answers "No mapping found" it means the mapping isn't known at
that point. Otherwise it will tell you what each of these keys is
mapped to, and by which script.


Best regards,
Tony.

Zhe Lee

unread,
Dec 27, 2016, 4:31:11 AM12/27/16
to vim_use

Tnx fix it, the command is Truly useful . : )

Reply all
Reply to author
Forward
0 new messages