Created
June 8, 2015 01:33
-
-
Save soulshake/5f37713e470cb53a6fab to your computer and use it in GitHub Desktop.
toggle paste mode automatically in vim
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
" never do this again --> :set paste <ctrl-v> :set no paste | |
let &t_SI .= "\<Esc>[?2004h" | |
let &t_EI .= "\<Esc>[?2004l" | |
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin() | |
function! XTermPasteBegin() | |
set pastetoggle=<Esc>[201~ | |
set paste | |
return "" | |
endfunction | |
" hat tip https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment