summaryrefslogtreecommitdiffstats
path: root/runtime/vimrc_example.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-06-25 20:13:35 +0000
committerBram Moolenaar <Bram@vim.org>2008-06-25 20:13:35 +0000
commitaba8857aa3dac629dc9c2a61c70bceee8b095e14 (patch)
treed2ba4671d3af28fb2b87110b7eae7b573f257904 /runtime/vimrc_example.vim
parent7b6d4a8ce837e4a0b8484dbbacb4ebcc9995f6fb (diff)
updated for version 7.2a-00v7.2a.00
Diffstat (limited to 'runtime/vimrc_example.vim')
-rw-r--r--runtime/vimrc_example.vim17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
index eaf3fd6bae..a2a891c167 100644
--- a/runtime/vimrc_example.vim
+++ b/runtime/vimrc_example.vim
@@ -1,7 +1,7 @@
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2006 Nov 16
+" Last change: 2008 Jun 16
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
@@ -37,6 +37,10 @@ set incsearch " do incremental searching
" Don't use Ex mode, use Q for formatting
map Q gq
+" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
+" so that you can undo CTRL-U after inserting a line break.
+inoremap <C-U> <C-G>u<C-U>
+
" In many terminal emulators the mouse works just fine, thus enable it.
set mouse=a
@@ -66,8 +70,10 @@ if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
+ " Also don't do it when the mark is in the first line, that is the default
+ " position when opening a file.
autocmd BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
@@ -81,5 +87,8 @@ endif " has("autocmd")
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
-command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
- \ | wincmd p | diffthis
+" Only define it when not defined already.
+if !exists(":DiffOrig")
+ command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
+ \ | wincmd p | diffthis
+endif