Sunday, January 29, 2012

Re: [vim] Problem with `inoremap jj '

On 2012-01-29, Clark J. Wang wrote:
> On Monday, January 30, 2012 2:56:37 PM UTC+8, Gary Johnson wrote:
>
> On 2012-01-29, Clark J. Wang wrote:
> > As recommended by other people I have 'inoremap jj <ESC>' defined in my
> vimrc
> > and it works well for most of the time.
> >
> > A few days ago when I copy-n-paste a lot of text into vim, the result was
> > always wrong. It took me quite a while before I figured out that there
> was a
> > substring "jj" included in the text to be pasted. For now I often :set
> paste
> > before copying large text to avoid unexpected behavior.
>
> How are you copy-n-pasting? If you are using a vim with the X11 and
> xterm-clipboard features enabled, have mouse=a, and are pasting with
> a mouse in a suitable terminal such as GNOME Terminal or xterm, Vim
> will detect that you are pasting and disable mappings.
>
>
> I usually use vim without X11 from a terminal and the TERM var may be set to
> linux (for Linux), dtterm (for Solaris), xterm-color (for OS X) or screen
> (within GNU screen).

What do you mean by "a terminal"? Are you not in an X11
environment, or are you just using a vim without X11? If the
latter, that's your problem. Vim doesn't have to run as gvim to
take advantage of X11 features. Try using "gvim -v" instead of
"vim", with mouse=a, and see if that helps. That will give you a
terminal-mode vim with X11 features enabled.

Copying and pasting works fine for me using either xterm or GNOME
Terminal, whether using screen or not, and whether TERM is set to
xterm, xterm-color or screen. I've never used dtterm--I just built
xterm for Solaris.

Regards,
Gary

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

No comments: