Ever copy something to your clipboard to NOT have it appear as you would expect in Vim? Pasting from another application to Vim yields wonky results because Vim doesn’t know how to handle the clipboard’s content.
Vim has a paste mode you can toggle on or off using
:set paste and
Vim has a one liner you can add to
vimrc to transform
function! TogglePaste() if(&paste == 0) set paste echo "Paste Mode Enabled" else set nopaste echo "Paste Mode Disabled" endif endfunction map <leader>p :call TogglePaste()<cr>
My leader button of choice is
\p to toggle your paste on and off.