Skip to content

Instantly share code, notes, and snippets.

Created Mar 2, 2018
What would you like to do?
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
" 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