In Vim, why doesn't my mouse work past the 220th column?

前端 未结 3 1793
萌比男神i
萌比男神i 2020-12-24 04:29

I tend to maximize a terminal to one screen, and vertically split several windows in Vim. Everything works fine for the first few windows on the left, but clicking past abou

相关标签:
3条回答
  • 2020-12-24 05:04

    A few years later, the bug still seems to be present. The solution I found is neovim: a modern refactor of vim. Among other features, this bug has been resolved.

    I simply copied my .vimrc into .nvimrc, and my plugins just worked with nvim. Maybe I'll just keep using that.

    0 讨论(0)
  • 2020-12-24 05:12

    Edit:
    I deleted the bug report, as that tracker was for the website, not the text editor.

    In looking in the correct place for an existing bug report, I found this: http://groups.google.com/group/vim_dev/browse_thread/thread/4c137e64d2032441/b3993eaa89589619?lnk=gst&q=mouse#b3993eaa89589619

    To summarize, it was an xterm limitation that has been lifted. However, Vim does not yet support columns longer than 223.


    Original:
    This seems to be a bug, as supported by comments made by redstreet. I filed a bug report:

    https://sourceforge.net/tracker/?func=detail&aid=3389331&group_id=27891&atid=391887

    0 讨论(0)
  • 2020-12-24 05:21

    This has been fixed in Vim 7.3.632. See :h sgr-mouse. Or just put this in your ~/.vimrc:

    set ttymouse=sgr
    

    If you want to be compatible with versions that don't have mouse_sgr compiled in, use:

    if has("mouse_sgr")
        set ttymouse=sgr
    else
        set ttymouse=xterm2
    end
    

    To see if your version of Vim has mouse_sgr, run vim --version from the command-line, or in Vim, enter :version, and look for +mouse_sgr.

    If you're using older versions of screen, or terminal emulators that don't support SGR, you may need to upgrade or switch. These settings work with all new versions of screen, tmux, gnome-terminal, PuTTY/KiTTY, iTerm2, and Terminal.app, using TERM=xterm-256color or screen-256color.

    Update: If you're using neovim, SGR support is enabled by default.

    0 讨论(0)
提交回复
热议问题