Mercurial > vim
annotate runtime/vimrc_example.vim @ 29071:b90bca860b5a v8.2.5057
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Commit: https://github.com/vim/vim/commit/6574577cacd393ab7591fc776ea060eebc939e55
Author: Paul Ollis <paul@cleversheep.org>
Date: Sun Jun 5 16:55:54 2022 +0100
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Problem: Using gettimeofday() for timeout is very inefficient.
Solution: Set a platform dependent timer. (Paul Ollis, closes https://github.com/vim/vim/issues/10505)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Jun 2022 18:00:08 +0200 |
parents | 22f0dda71638 |
children | 4027cefc2aab |
rev | line source |
---|---|
7 | 1 " An example for a vimrc file. |
2 " | |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
18912
ccd16426a1f9
patch 8.2.0017: OS/2 and MS-DOS are still mentioned
Bram Moolenaar <Bram@vim.org>
parents:
15729
diff
changeset
|
4 " Last change: 2019 Dec 17 |
7 | 5 " |
6 " To use it, copy it to | |
18912
ccd16426a1f9
patch 8.2.0017: OS/2 and MS-DOS are still mentioned
Bram Moolenaar <Bram@vim.org>
parents:
15729
diff
changeset
|
7 " for Unix: ~/.vimrc |
7 | 8 " for Amiga: s:.vimrc |
18912
ccd16426a1f9
patch 8.2.0017: OS/2 and MS-DOS are still mentioned
Bram Moolenaar <Bram@vim.org>
parents:
15729
diff
changeset
|
9 " for MS-Windows: $VIM\_vimrc |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18912
diff
changeset
|
10 " for Haiku: ~/config/settings/vim/vimrc |
7 | 11 " for OpenVMS: sys$login:.vimrc |
12 | |
15729 | 13 " When started as "evim", evim.vim will already have done these settings, bail |
14 " out. | |
7 | 15 if v:progname =~? "evim" |
16 finish | |
17 endif | |
18 | |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
19 " Get the defaults that most users want. |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
20 source $VIMRUNTIME/defaults.vim |
7 | 21 |
22 if has("vms") | |
23 set nobackup " do not keep a backup file, use versions instead | |
24 else | |
5637 | 25 set backup " keep a backup file (restore to previous version) |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
26 if has('persistent_undo') |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
27 set undofile " keep an undo file (undo changes after closing) |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
28 endif |
1668 | 29 endif |
7 | 30 |
31 if &t_Co > 2 || has("gui_running") | |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9344
diff
changeset
|
32 " Switch on highlighting the last used search pattern. |
7 | 33 set hlsearch |
34 endif | |
35 | |
15729 | 36 " Put these in an autocmd group, so that we can delete them easily. |
37 augroup vimrcEx | |
7 | 38 au! |
39 | |
40 " For all text files set 'textwidth' to 78 characters. | |
41 autocmd FileType text setlocal textwidth=78 | |
15729 | 42 augroup END |
1125 | 43 |
8720
9380c37723f8
commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
44 " Add optional packages. |
9380c37723f8
commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
45 " |
9380c37723f8
commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
46 " The matchit plugin makes the % command work better, but it is not backwards |
9380c37723f8
commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
47 " compatible. |
12559 | 48 " The ! means the package won't be loaded right away but when plugins are |
49 " loaded during initialization. | |
9344
33c1b85d408c
commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents:
8853
diff
changeset
|
50 if has('syntax') && has('eval') |
12559 | 51 packadd! matchit |
9344
33c1b85d408c
commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Christian Brabandt <cb@256bit.org>
parents:
8853
diff
changeset
|
52 endif |