Is there a key map conflict in my Vim?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is there a key map conflict in my Vim?

Zhe Lee
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


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is there a key map conflict in my Vim?

Tony Mechelynck
On Fri, Dec 23, 2016 at 2:22 AM, Zhe Lee <[hidden email]> wrote:

> 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

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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is there a key map conflict in my Vim?

Zhe Lee
On Saturday, December 24, 2016 at 7:36:55 AM UTC+8, Tony Mechelynck wrote:

> On Fri, Dec 23, 2016 at 2:22 AM, Zhe Lee <[hidden email]> wrote:
> > 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
>
> 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.
Tnx fix it, the command is Truly useful . : )

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...