Skip to content

Instantly share code, notes, and snippets.

@ttdoda
Last active November 28, 2019 03:50
Show Gist options
  • Save ttdoda/a45cf0b462cdb74e887f7125165449c4 to your computer and use it in GitHub Desktop.
Save ttdoda/a45cf0b462cdb74e887f7125165449c4 to your computer and use it in GitHub Desktop.
tmux使用時のvimでのBracketed Paste Mode有効化
if has('patch-8.0.0238')
if &term =~ "screen"
let &t_BE = "\e[?2004h"
let &t_BD = "\e[?2004l"
exec "set t_PS=\e[200~"
exec "set t_PE=\e[201~"
endif
else
if has('patch-8.0.0210')
set t_BE=
endif
if &term =~ "xterm" || &term =~ "screen"
function XTermPasteBegin(ret)
set paste
set pastetoggle=<Esc>[201~
return a:ret
endfunction
let &t_ti .= "\e[?2004h"
let &t_te .= "\e[?2004l"
noremap <special> <expr> <Esc>[200~ XTermPasteBegin("0i")
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin("")
vnoremap <special> <expr> <Esc>[200~ XTermPasteBegin("c")
cnoremap <special> <Esc>[200~ <nop>
cnoremap <special> <Esc>[201~ <nop>
endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment