updated vimrc: no more set paste (hopefully)

This commit is contained in:
Johannes Merz 2025-11-21 12:03:20 +01:00
parent 2cb1e9d210
commit 085a777e7d
1 changed files with 23 additions and 0 deletions

View File

@ -389,3 +389,26 @@ set undodir=~/.vim/undodir
" correct yaml settings " correct yaml settings
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" no more :set paste (hopefully)
if exists("g:loaded_bracketed_paste")
finish
endif
let g:loaded_bracketed_paste = 1
let &t_ti .= "\<Esc>[?2004h"
let &t_te = "\e[?2004l" . &t_te
function! XTermPasteBegin(ret)
set pastetoggle=<f29>
set paste
return a:ret
endfunction
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
map <expr> <f28> XTermPasteBegin("i")
imap <expr> <f28> XTermPasteBegin("")
vmap <expr> <f28> XTermPasteBegin("c")
cmap <f28> <nop>
cmap <f29> <nop>