Skip to content

Instantly share code, notes, and snippets.

@agriffis
Created Mar 2, 2018
Embed
What would you like to do?
EnableBracketedPaste
function! EnableBracketedPaste()
" Enable bracketed paste everywhere. This would happen automatically on
" local terms, even with mosh using TERM=xterm*, but doesn't happen
" automatically in tmux with TERM=screen*. Setting it manually works fine.
if ! has("gui_running") && exists('&t_BE') && &t_BE == ''
let &t_BE = "\e[?2004h" " enable
let &t_BD = "\e[?2004l" " disable
let &t_PS = "\e[200~" " start
let &t_PE = "\e[201~" " end
endif
endfunction
" call immediately, isn't effective after TermResponse
call EnableBracketedPaste()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment