[Ttssh2-commit] [6583] Vim 8.0.0238 での Bracketed Paste Mode 対応にあわせて更新。

svnno****@sourc***** svnno****@sourc*****
2017年 1月 30日 (月) 16:34:39 JST


Revision: 6583
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6583
Author:   doda
Date:     2017-01-30 16:34:38 +0900 (Mon, 30 Jan 2017)
Log Message:
-----------
Vim 8.0.0238 での Bracketed Paste Mode 対応にあわせて更新。

Modified Paths:
--------------
    trunk/doc/en/html/usage/tips/vim.html
    trunk/doc/ja/html/usage/tips/vim.html

-------------- next part --------------
Modified: trunk/doc/en/html/usage/tips/vim.html
===================================================================
--- trunk/doc/en/html/usage/tips/vim.html	2017-01-19 12:44:44 UTC (rev 6582)
+++ trunk/doc/en/html/usage/tips/vim.html	2017-01-30 07:34:38 UTC (rev 6583)
@@ -63,6 +63,11 @@
 
 
 <h2><a name="Bracketed">Auto indent can be disabled on pasting from clipboard</a></h2>
+<!-- p class="notice">
+\x92\x8D: Vim 8.0.0238 \x82\xE6\x82\xE8 Vim \x96{\x91̂\xC5 Bracketed Paste Mode \x82ɑΉ\x9E\x82\xB5\x82\xBD\x88ׁA\x89\xBA\x8BL\x82̐ݒ\xE8\x82\xF0\x92lj\xC1\x82\xB5\x82Ȃ\xAD\x82Ă\xE0\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɂ͎\xA9\x93\xAE\x83C\x83\x93\x83f\x83\x93\x83g\x82\xE2\x95⊮\x93\x99\x82\xAA\x96\xB3\x8C\xF8\x82ɂȂ\xE8\x82܂\xB7\x81B<br>
+\x82\xB5\x82\xA9\x82\xB5\x81Atmux \x97\x98\x97p\x8E\x9E\x82ɂ\xCD Bracketed Paste Mode \x82\xAA\x97L\x8C\xF8\x82ɂȂ\xE7\x82Ȃ\xA2\x82̂ŁAtmux \x82𕹗p\x82\xB7\x82\xE9\x8Fꍇ\x82͈ˑR\x82Ƃ\xB5\x82ĉ\xBA\x8BL\x82̐ݒ肪\x95K\x97v\x82ɂȂ\xE8\x82܂\xB7\x81B
+</p -->
+
 <p>
 Basically, the host application can not recognize the difference between the user input and pasting from clipboard.
 However, when a user uses the Bracketed Paste Mode as the xterm extension, the application can recognize its difference and a user can change the behavior of pasting from clipboard.
@@ -73,20 +78,48 @@
 </p>
 
 <pre class="macro-example">
-if &amp;term =~ "xterm"
-    let &amp;t_ti .= "\e[?2004h"
-    let &amp;t_te .= "\e[?2004l"
-    let &amp;pastetoggle = "\e[201~"
+if has("patch-8.0.0238")
+<!--
+    " Bracketed Paste Mode\x91Ή\x9E\x83o\x81[\x83W\x83\x87\x83\x93(8.0.0238\x88ȍ~)\x82ł́A\x93\xC1\x82ɐݒ肵\x82Ȃ\xA2
+    " \x8Fꍇ\x82\xCDTERM\x82\xAAxterm\x82̎\x9E\x82̂\xDDBracketed Paste Mode\x82\xAA\x8Eg\x82\xED\x82\xEA\x82\xE9\x81B
+    " tmux\x97\x98\x97p\x8E\x9E\x82\xCDTERM\x82\xAAscreen\x82Ȃ̂ŁABracketed Paste Mode\x82𗘗p\x82\xB7\x82\xE9\x82ɂ\xCD
+    " \x88ȉ\xBA\x82̐ݒ肪\x95K\x97v\x82ƂȂ\xE9\x81B
+-->
+    if &amp;term =~ "screen"
+        let &amp;t_BE = "\e[?2004h"
+        let &amp;t_BD = "\e[?2004l"
+        exec "set t_PS=\e[200~"
+        exec "set t_PE=\e[201~"
+    endif
+else
+<!--
+    " 8.0.0210 \x81` 8.0.0237 \x82ł\xCDVim\x96{\x91̂ł\xCCBracketed Paste Mode\x91Ή\x9E\x82̋\x93\x93\xAE\x82\xAA
+    " \x96]\x82܂\xB5\x82\xAD\x82Ȃ\xA2(\x8E\xA9\x93\xAE\x83C\x83\x93\x83f\x83\x93\x83g\x82\xAA\x96\xB3\x8C\xF8\x82ɂȂ\xE7\x82Ȃ\xA2)\x82̂ŁAVim\x96{\x91̑\xA4\x82ł̑Ή\x9E\x82\xF0
+    " \x96\xB3\x8C\xF8\x82ɂ\xB7\x82\xE9\x81B
+-->
+    if has("patch-8.0.0210")
+        set t_BE=
+    endif
 
-    function XTermPasteBegin(ret)
-        set paste
-        return a:ret
-    endfunction
+<!--
+    " Vim\x96{\x91̂\xAABracketed Paste Mode\x82ɑΉ\x9E\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x8E\x9E\x82ׂ̈̐ݒ\xE8\x81B
+-->
+    if &amp;term =~ "xterm" || &amp;term =~ "screen"
+        let &amp;t_ti .= "\e[?2004h"
+        let &amp;t_te .= "\e[?2004l"
 
-    noremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("0i")
-    inoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("")
-    cnoremap &lt;special&gt; &lt;Esc&gt;[200~ &lt;nop&gt;
-    cnoremap &lt;special&gt; &lt;Esc&gt;[201~ &lt;nop&gt;
+        function XTermPasteBegin(ret)
+            set pastetoggle=&lt;Esc&gt;[201~
+            set paste
+            return a:ret
+        endfunction
+
+        noremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("0i")
+        inoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("")
+        vnoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("c")
+        cnoremap &lt;special&gt; &lt;Esc&gt;[200~ &lt;nop&gt;
+        cnoremap &lt;special&gt; &lt;Esc&gt;[201~ &lt;nop&gt;
+    endif
 endif
 </pre>
 
@@ -99,9 +132,9 @@
 if &amp;term =~ "xterm"
     let &amp;t_SI .= "\e[?2004h"
     let &amp;t_EI .= "\e[?2004l"
-    let &amp;pastetoggle = "\e[201~"
 
     function XTermPasteBegin(ret)
+        set pastetoggle=&lt;Esc&gt;[201~
         set paste
         return a:ret
     endfunction

Modified: trunk/doc/ja/html/usage/tips/vim.html
===================================================================
--- trunk/doc/ja/html/usage/tips/vim.html	2017-01-19 12:44:44 UTC (rev 6582)
+++ trunk/doc/ja/html/usage/tips/vim.html	2017-01-30 07:34:38 UTC (rev 6583)
@@ -63,6 +63,11 @@
 
 
 <h2><a name="Bracketed">\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA9\x82\xE7\x82̓\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82Ɏ\xA9\x93\xAE\x83C\x83\x93\x83f\x83\x93\x83g\x82𖳌\xF8\x82ɂ\xB7\x82\xE9</a></h2>
+<p class="notice">
+\x92\x8D: Vim 8.0.0238 \x82\xE6\x82\xE8 Vim \x96{\x91̂\xC5 Bracketed Paste Mode \x82ɑΉ\x9E\x82\xB5\x82\xBD\x88ׁA\x89\xBA\x8BL\x82̐ݒ\xE8\x82\xF0\x92lj\xC1\x82\xB5\x82Ȃ\xAD\x82Ă\xE0\x93\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82ɂ͎\xA9\x93\xAE\x83C\x83\x93\x83f\x83\x93\x83g\x82\xE2\x95⊮\x93\x99\x82\xAA\x96\xB3\x8C\xF8\x82ɂȂ\xE8\x82܂\xB7\x81B<br>
+\x82\xB5\x82\xA9\x82\xB5\x81Atmux \x97\x98\x97p\x8E\x9E\x82ɂ\xCD Bracketed Paste Mode \x82\xAA\x97L\x8C\xF8\x82ɂȂ\xE7\x82Ȃ\xA2\x82̂ŁAtmux \x82𕹗p\x82\xB7\x82\xE9\x8Fꍇ\x82͈ˑR\x82Ƃ\xB5\x82ĉ\xBA\x8BL\x82̐ݒ肪\x95K\x97v\x82ɂȂ\xE8\x82܂\xB7\x81B
+</p>
+
 <p>
 \x92ʏ\xED\x81A\x83z\x83X\x83g\x91\xA4\x82̃A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93 (vim \x93\x99) \x82\xA9\x82\xE7\x82́A\x83\x86\x81[\x83U\x82̃L\x81[\x93\xFC\x97͂ƃN\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA9\x82\xE7\x82̓\\x82\xE8\x95t\x82\xAF\x82\xF0\x8B\xE6\x95ʂł\xAB\x82܂\xB9\x82\xF1\x81B
 \x82\xB5\x82\xA9\x82\xB5 xterm \x82̊g\x92\xA3\x8B@\x94\\x82ł\xA0\x82\xE9 Bracketed Paste Mode \x82𗘗p\x82\xB7\x82\xE9\x82Ƃ\xB1\x82\xEA\x82\xE7\x82\xF0\x8B\xE6\x95ʏo\x97\x88\x82\xE9\x82悤\x82ɂȂ邽\x82߁A\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82\xA9\x82\xE7\x82̓\\x82\xE8\x95t\x82\xAF\x8E\x9E\x82͓\xAE\x8D\xEC\x82\xF0\x95ς\xA6\x82鎖\x82\xAA\x82ł\xAB\x82܂\xB7\x81B
@@ -73,20 +78,42 @@
 </p>
 
 <pre class="macro-example">
-if &amp;term =~ "xterm"
-    let &amp;t_ti .= "\e[?2004h"
-    let &amp;t_te .= "\e[?2004l"
-    let &amp;pastetoggle = "\e[201~"
+if has("patch-8.0.0238")
+    " Bracketed Paste Mode\x91Ή\x9E\x83o\x81[\x83W\x83\x87\x83\x93(8.0.0238\x88ȍ~)\x82ł́A\x93\xC1\x82ɐݒ肵\x82Ȃ\xA2
+    " \x8Fꍇ\x82\xCDTERM\x82\xAAxterm\x82̎\x9E\x82̂\xDDBracketed Paste Mode\x82\xAA\x8Eg\x82\xED\x82\xEA\x82\xE9\x81B
+    " tmux\x97\x98\x97p\x8E\x9E\x82\xCDTERM\x82\xAAscreen\x82Ȃ̂ŁABracketed Paste Mode\x82𗘗p\x82\xB7\x82\xE9\x82ɂ\xCD
+    " \x88ȉ\xBA\x82̐ݒ肪\x95K\x97v\x82ƂȂ\xE9\x81B
+    if &amp;term =~ "screen"
+        let &amp;t_BE = "\e[?2004h"
+        let &amp;t_BD = "\e[?2004l"
+        exec "set t_PS=\e[200~"
+        exec "set t_PE=\e[201~"
+    endif
+else
+    " 8.0.0210 \x81` 8.0.0237 \x82ł\xCDVim\x96{\x91̂ł\xCCBracketed Paste Mode\x91Ή\x9E\x82̋\x93\x93\xAE\x82\xAA
+    " \x96]\x82܂\xB5\x82\xAD\x82Ȃ\xA2(\x8E\xA9\x93\xAE\x83C\x83\x93\x83f\x83\x93\x83g\x82\xAA\x96\xB3\x8C\xF8\x82ɂȂ\xE7\x82Ȃ\xA2)\x82̂ŁAVim\x96{\x91̑\xA4\x82ł̑Ή\x9E\x82\xF0
+    " \x96\xB3\x8C\xF8\x82ɂ\xB7\x82\xE9\x81B
+    if has("patch-8.0.0210")
+        set t_BE=
+    endif
 
-    function XTermPasteBegin(ret)
-        set paste
-        return a:ret
-    endfunction
+    " Vim\x96{\x91̂\xAABracketed Paste Mode\x82ɑΉ\x9E\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x8E\x9E\x82ׂ̈̐ݒ\xE8\x81B
+    if &amp;term =~ "xterm" || &amp;term =~ "screen"
+        let &amp;t_ti .= "\e[?2004h"
+        let &amp;t_te .= "\e[?2004l"
 
-    noremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("0i")
-    inoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("")
-    cnoremap &lt;special&gt; &lt;Esc&gt;[200~ &lt;nop&gt;
-    cnoremap &lt;special&gt; &lt;Esc&gt;[201~ &lt;nop&gt;
+        function XTermPasteBegin(ret)
+            set pastetoggle=&lt;Esc&gt;[201~
+            set paste
+            return a:ret
+        endfunction
+
+        noremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("0i")
+        inoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("")
+        vnoremap &lt;special&gt; &lt;expr&gt; &lt;Esc&gt;[200~ XTermPasteBegin("c")
+        cnoremap &lt;special&gt; &lt;Esc&gt;[200~ &lt;nop&gt;
+        cnoremap &lt;special&gt; &lt;Esc&gt;[201~ &lt;nop&gt;
+    endif
 endif
 </pre>
 
@@ -99,9 +126,9 @@
 if &amp;term =~ "xterm"
     let &amp;t_SI .= "\e[?2004h"
     let &amp;t_EI .= "\e[?2004l"
-    let &amp;pastetoggle = "\e[201~"
 
     function XTermPasteBegin(ret)
+        set pastetoggle=&lt;Esc&gt;[201~
         set paste
         return a:ret
     endfunction



Ttssh2-commit メーリングリストの案内