Bug#204373: My keyboard shortcut mapping stopped working

jamessan@jamessan.com jamessan@jamessan.com
Wed, 13 Apr 2005 22:19:37 -0400


--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

On Fri, Apr 01, 2005 at 12:56:27PM +0300, Juhapekka Tolvanen wrote:
> jamessan@jamessan.com writes:
>
> >> I have these lines in my .vimrc:
> >>
> >> " Use Ctrl-J just like in pico or nano
> >> nmap <C-J> vipgq
> >> nmap <C-J>    gq
> >>
> >> With those settings I was able to justify text with Ctrl-J just like in
> >> pico or nano. But somehow that stopped working! Now my Vim just goes to
> >> insert-mode and nothing else happens.
> >
> > Can you still reproduce this?  I've tried with the latest in unstable
> > (6.3-068+3) and was unable.
>
> Yes, this bug still exist. How you would implement that pico-like
> behaviour in Vim? Are some commented lines from my current ~/.vimrc :

The pico-like behavior being "use Ctrl-J to re-wrap text"?

> " Use Ctrl-J to justify just like in pico or nano
> " In Vim LaTeX Suite Ctrl-j is already reserved.
>
> " In visual mode format the highlighted text
> "vmap <C-J>    gq<CR>

This mapping worked fine for me.  The <CR> is unnecessary, but the
mapping did perform the re-wrapping.

> " In normal mode format current paragraph
> "nmap <C-J>    gqap<CR>

This mapping worked fine for me.  The <CR> is unnecessary, but the
mapping did perform the re-wrapping.

> " In insert mode format current paragraph
> "imap <C-J>    <ESC>gqap<CR>i

This mapping worked fine for me.  The <CR> is unnecessary, but the
mapping did perform the re-wrapping.

> " Use Ctrl-J just like in pico or nano
> "nmap <C-J> vipgq

This mapping worked fine for me.

> "nmap <C-J>    gq

This mapping puts Vim into "operator pending" mode.  It is waiting for
you to specify a motion or to press q again.

Maybe you have a conflicting mapping setup somewhere.  Could you startup
a fresh Vim session, and send the results of the following commands:

:let @a=""
:redir @A
:map
:redir END
"ap

Thanks,

James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@jamessan.com>

--2B/JsCI69OhZNC5r
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iEYEARECAAYFAkJd0zkACgkQDb3UpmEybUA3IgCfYxmhTE7mKl/cJMu6vBD6shBL
c4cAniYlvBnEKQgmWAGHDFehgxrboXu0
=ORNu
-----END PGP SIGNATURE-----

--2B/JsCI69OhZNC5r--