From 99af2287c57bd8cd2171dabd79f53e09aba37720 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 16 Sep 2021 11:07:56 -0700 Subject: [PATCH] Add bracketed paste mode to vimrc. --- dotfiles/vimrc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 905aa67..11f6469 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -151,6 +151,31 @@ if isdirectory("/usr/share/vim-youcompleteme") && empty($VIRTUAL_ENV) set runtimepath+=/usr/share/vim-youcompleteme endif +" Enable vim-bracketed-paste mode +" From +" https://github.com/ConradIrwin/vim-bracketed-paste/blob/master/plugin/bracketed-paste.vim +if exists("g:loaded_bracketed_paste") + finish +endif +let g:loaded_bracketed_paste = 1 + +let &t_ti .= "\[?2004h" +let &t_te = "\e[?2004l" . &t_te + +function! XTermPasteBegin(ret) + set pastetoggle= + set paste + return a:ret +endfunction + +execute "set =\[200~" +execute "set =\[201~" +map XTermPasteBegin("i") +imap XTermPasteBegin("") +vmap XTermPasteBegin("c") +cmap +cmap + " Include a .vimrc.local if it exists if filereadable(glob("~/.vimrc.local")) source ~/.vimrc.local