Created
March 2, 2018 02:59
-
-
Save agriffis/35703d697bbb7c6adb52bc4218b9daff to your computer and use it in GitHub Desktop.
EnableBracketedPaste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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