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

前端 未结 3 1792
萌比男神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: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.

提交回复
热议问题