xref: /vim-8.2.3635/runtime/vimrc_example.vim (revision 8024f936)
1" An example for a vimrc file.
2"
3" Maintainer:	Bram Moolenaar <[email protected]>
4" Last change:	2019 Dec 17
5"
6" To use it, copy it to
7"	       for Unix:  ~/.vimrc
8"	      for Amiga:  s:.vimrc
9"	 for MS-Windows:  $VIM\_vimrc
10"	    for OpenVMS:  sys$login:.vimrc
11
12" When started as "evim", evim.vim will already have done these settings, bail
13" out.
14if v:progname =~? "evim"
15  finish
16endif
17
18" Get the defaults that most users want.
19source $VIMRUNTIME/defaults.vim
20
21if has("vms")
22  set nobackup		" do not keep a backup file, use versions instead
23else
24  set backup		" keep a backup file (restore to previous version)
25  if has('persistent_undo')
26    set undofile	" keep an undo file (undo changes after closing)
27  endif
28endif
29
30if &t_Co > 2 || has("gui_running")
31  " Switch on highlighting the last used search pattern.
32  set hlsearch
33endif
34
35" Put these in an autocmd group, so that we can delete them easily.
36augroup vimrcEx
37  au!
38
39  " For all text files set 'textwidth' to 78 characters.
40  autocmd FileType text setlocal textwidth=78
41augroup END
42
43" Add optional packages.
44"
45" The matchit plugin makes the % command work better, but it is not backwards
46" compatible.
47" The ! means the package won't be loaded right away but when plugins are
48" loaded during initialization.
49if has('syntax') && has('eval')
50  packadd! matchit
51endif
52