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