]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
vimrc: Automatically reset paste after exiting insert mode.
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index b0665efb553d9ce198950d1fcc9884fbc8a893cb..67e197d031980f5a77cbe36223df8bd3fe416874 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -361,6 +361,11 @@ if has('autocmd')
             \     setlocal nonumber |
             \ endif
 
+" Automatically disable 'paste' mode when leaving insert mode. Thanks to
+" Raimondi in #vim on Freenode (2010-08-14 23:01 CEST). Very useful as I only
+" want to paste once and then 'paste' gets automatically unset.
+        autocmd InsertLeave * set nopaste
+
 " AFTER/FTPLUGIN AUTO COMMANDS
 
 " Disable spell checking for files which don't need it.