]> 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 d0371b559d90896cd8a629b08731fd4c3d5e431c..67e197d031980f5a77cbe36223df8bd3fe416874 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -209,6 +209,11 @@ cnoremap <C-n> <down>
 nnoremap <Space> <C-f>
 nnoremap - <C-b>
 
+" Go to next and previous buffer. Thanks to elik in #vim on Freenode
+" (2010-05-16 18:38) for this idea.
+nnoremap <silent> gb :bnext<CR>
+nnoremap <silent> gB :bprev<CR>
+
 " Fast access to buffers.
 nnoremap <Leader>1 :1b<CR>
 nnoremap <Leader>2 :2b<CR>
@@ -356,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.