annotate runtime/vimrc_example.vim @ 1277:4a0d055d5f03

updated for version 7.1
author vimboss
date Sat, 12 May 2007 15:12:15 +0000
parents 96cd8222a819
children 58cad056e608
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " An example for a vimrc file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
4 " Last change: 2006 Nov 16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " To use it, copy it to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " for Unix and OS/2: ~/.vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " for Amiga: s:.vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " for MS-DOS and Win32: $VIM\_vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " for OpenVMS: sys$login:.vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " When started as "evim", evim.vim will already have done these settings.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 if v:progname =~? "evim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Use Vim settings, rather then Vi settings (much better!).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " This must be first, because it changes other options as a side effect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 set nocompatible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " allow backspacing over everything in insert mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 set backspace=indent,eol,start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 if has("vms")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 set nobackup " do not keep a backup file, use versions instead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 set backup " keep a backup file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 set history=50 " keep 50 lines of command line history
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 set ruler " show the cursor position all the time
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 set showcmd " display incomplete commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 set incsearch " do incremental searching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " let &guioptions = substitute(&guioptions, "t", "", "g")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Don't use Ex mode, use Q for formatting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 map Q gq
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
40 " In many terminal emulators the mouse works just fine, thus enable it.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
41 set mouse=a
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Switch syntax highlighting on, when the terminal has colors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Also switch on highlighting the last used search pattern.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if &t_Co > 2 || has("gui_running")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syntax on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 set hlsearch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " Only do this part when compiled with support for autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 if has("autocmd")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Enable file type detection.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Use the default filetype settings, so that mail gets 'tw' set to 72,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " 'cindent' is on in C files, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Also load indent files, to automatically do language-dependent indenting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 filetype plugin indent on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Put these in an autocmd group, so that we can delete them easily.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 augroup vimrcEx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 au!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " For all text files set 'textwidth' to 78 characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 autocmd FileType text setlocal textwidth=78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " When editing a file, always jump to the last known cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " Don't do it when the position is invalid or when inside an event handler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " (happens when dropping a file on gvim).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 autocmd BufReadPost *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 \ if line("'\"") > 0 && line("'\"") <= line("$") |
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
71 \ exe "normal! g`\"" |
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 \ endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 set autoindent " always set autoindenting on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 endif " has("autocmd")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
81
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
82 " Convenient command to see the difference between the current buffer and the
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
83 " file it was loaded from, thus the changes you made.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
84 command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
85 \ | wincmd p | diffthis