Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active August 29, 2015 13:56
Show Gist options
  • Save saitoha/8932633 to your computer and use it in GitHub Desktop.
Save saitoha/8932633 to your computer and use it in GitHub Desktop.
[vim] document fix for mouse options
diff -r 609b7c0be284 runtime/doc/options.txt
--- a/runtime/doc/options.txt Tue Apr 29 20:04:09 2014 +0200
+++ b/runtime/doc/options.txt Wed Apr 30 16:52:10 2014 +0900
@@ -7504,8 +7504,8 @@
"s" = button state
"c" = column plus 33
"r" = row plus 33
- This only works up to 223 columns! See "dec" for a
- solution.
+ This only works up to 223 columns! See "dec",
+ "urxvt", and "sgr" for solutions.
xterm2 Works like "xterm", but with the xterm reporting the
mouse position while the mouse is dragged. This works
much faster and more precise. Your xterm must at
@@ -7527,29 +7527,35 @@
pterm QNX pterm mouse handling.
*urxvt-mouse*
urxvt Mouse handling for the urxvt (rxvt-unicode) terminal.
+ The mouse works only if the terminal support this
+ encoding style, but it does not have 223 columns limit
+ unlike "xterm" or "xterm2".
*sgr-mouse*
sgr Mouse handling for the terminal that emits SGR-styled
- mouse reporting. Works with xterm version 277 or
- later.
+ mouse reporting. The mouse works even in columns
+ beyond 223. This option is backward compatible with
+ "xterm2" because it can also decode "xterm2" style
+ mouse codes.
The mouse handling must be enabled at compile time |+mouse_xterm|
- |+mouse_dec| |+mouse_netterm|.
+ |+mouse_dec| |+mouse_netterm| |+mouse_jsbterm| |+mouse_urxvt|
+ |+mouse_sgr|.
Only "xterm"(2) is really recognized. NetTerm mouse codes are always
recognized, if enabled at compile time. DEC terminal mouse codes
are recognized if enabled at compile time, and 'ttymouse' is not
- "xterm" (because the xterm and dec mouse codes conflict).
+ "xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict
+ with them).
This option is automatically set to "xterm", when the 'term' option is
- set to a name that starts with "xterm", and 'ttymouse' is not "xterm"
- or "xterm2" already. The main use of this option is to set it to
- "xterm", when the terminal name doesn't start with "xterm", but it can
- handle xterm mouse codes.
- The "sgr" value will be set if the xterm version is 277 or later.
+ set to a name that starts with "xterm", "mlterm", or "screen", and
+ 'ttymouse' is not set already.
+ Additionally, if vim is compiled with the |+termresponse| feature and
+ |t_RV| is set to the escape sequence to request the xterm version
+ number, more intelligent detection process runs.
The "xterm2" value will be set if the xterm version is reported to be
- 95 or higher. This only works when compiled with the |+termresponse|
- feature and if |t_RV| is set to the escape sequence to request the
- xterm version number. Otherwise "xterm2" must be set explicitly.
- If you do not want 'ttymouse' to be set to "xterm2" automatically, set
- t_RV to an empty string: >
+ from 95 to 276. The "sgr" value will be set if the xterm version is
+ 277 or highter.
+ If you do not want 'ttymouse' to be set to "xterm2" or "sgr"
+ automatically, set t_RV to an empty string: >
:set t_RV=
<
*'ttyscroll'* *'tsl'*
diff -r 609b7c0be284 runtime/doc/term.txt
--- a/runtime/doc/term.txt Tue Apr 29 20:04:09 2014 +0200
+++ b/runtime/doc/term.txt Wed Apr 30 16:52:10 2014 +0900
@@ -666,8 +666,8 @@
*xterm-copy-paste*
NOTE: In some (older) xterms, it's not possible to move the cursor past column
-95. This is an xterm problem, not Vim's. Get a newer xterm |color-xterm|.
-Now the limit is 223 columns.
+95 or 223. This is an xterm problem, not Vim's. Get a newer xterm
+|color-xterm|.
Copy/paste in xterm with (current mode NOT included in 'mouse'):
1. Press left mouse button on first letter of text, move mouse pointer to last
diff -r 609b7c0be284 src/os_unix.c
--- a/src/os_unix.c Tue Apr 29 20:04:09 2014 +0200
+++ b/src/os_unix.c Wed Apr 30 16:52:10 2014 +0900
@@ -3783,7 +3783,7 @@
del_mouse_termcode(KS_URXVT_MOUSE);
# endif
# ifdef FEAT_MOUSE_SGR
- /* same as the dec mouse */
+ /* There is no conflict with xterm mouse */
if (use_xterm_mouse() == 4
# ifdef FEAT_GUI
&& !gui.in_use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment