Thursday, June 12, 2014

Re: Mapping only in specific buffer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Why are you using :norm here? Your mapping is incorrect:

1. You do not need :norm. Just using "]c" should be enough in this circumstances.
2. You do not need :map without n. Your mapping is not going to work in visual mode (as long as you use :normal).
3. You should not be using :map without nore and :normal without bang unless you have to.

What I would write is

noremap <expr> <F2> &diff ? ']c' : 'something else'

(note: just ']c' works in all modes noremap maps in, so I do not follow 2.).

On June 12, 2014 7:55:53 PM GMT+03:00, Ni Va <nivaemail@gmail.com> wrote:
>Hi,
>
>
>I would like to map ]c diff jump only in a vim buffer.
>
>I have done this for the moment but would like to make conditional test
>on &diff var :
>map <F2> : norm ]c<CR>
>
>
>Thank you
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTmdYTGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvqvWD/9AT+bcuChsthWqliMk2zFcwCNuKrdKYTuWwU8zaXRfl0+b6QIC/bSH
33AL9pzSEwKd8QSBS1l2FhO9edFY4p3YCMaXFrA3f9nR1CVvrsgP+HhSkmjRjIPo
vlI4MKNRqbeaoZ/sSqcOI7QzeOmARiAvk0gJvbDbFprPN2ywXxsb9tjBbn4unApD
dP2m5ys677Z+BrRCPKlbWrxAJD6RyMXtn0xbbbyRXyX+NHjXfH2Ja0y8KPBJRng7
f1pPQJZPP6m7PiYRBq0KVhFhcK2c3kil40br0ZSZMm+4k9FnIrk2mShl/QHeGQFZ
XZXHOnvQN12/D+YXvbX6WBlnxyXXemTzeuTPyLY2EBflDhEn6+NLL8EIyjj0Iec7
3/S6UKJ9jA3ohYbkWP7CWdWlGDlCdPleyt1u39cyh1Ly7SCgW5mt/Y0Drs8TIxnT
IbHwvjwa2rB7Z/sola9qljciabHqkkPGVlXRimkEXRlhJFsJ8UT2hTJmmN3MxLjc
Ib+ybbewwjGGRzSirHIfEmmWv2bBrtN5WQykCr2vYjlXYe3GAH306S4cHYNo1wSv
cDUicIpIYQ4HV/rZIkoshF+wq3xF9HO8bnvARwnWRgH0God28bhTObk82GpMp2Yf
jd02nV1THWgTwnoLz6ZkbRuvVGHzpMxx2+hx/smFfENyY1oRuEuwqA==
=WEaa
-----END PGP SIGNATURE-----

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: