Skip to content

Instantly share code, notes, and snippets.

@agriffis
Created March 2, 2018 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agriffis/35703d697bbb7c6adb52bc4218b9daff to your computer and use it in GitHub Desktop.
Save agriffis/35703d697bbb7c6adb52bc4218b9daff to your computer and use it in GitHub Desktop.
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