This repository was archived by the owner on Mar 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvimrc
More file actions
69 lines (53 loc) · 1.89 KB
/
vimrc
File metadata and controls
69 lines (53 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
vim9script
# This is the entry point for the Vim configuration. It is a wrapper
# which ensures a clean environment before loading the actual Vim
# configuration file and enforces some security settings afterwards.
# **NOTE**: If a vimrc file is present in the users $HOME dir (e.g.
# this file!) the 'compatible' option defaults to `false`. There is
# no need to set 'nocompatible'. In fact doing so has some nasty side
# effects!
# --------
# If set to `false` neither the actual configuration files nor the
# plugins and the plugin configuration files are loaded.
var load_vimrc = true
# If set to `false' neither the plugins nor the plugin configuration
# files are loaded.
var load_plugins = true
# --------
# Reset options.
set all&
# Reset highlights.
highlight clear
# Delete all autocommands defined by the configuration files. This
# prevents errors when the configuration is sourced a second time.
if exists('#vimrc')
autocmd_delete([{'group': 'vimrc'}])
endif
# --------
# Do not load the plugins if either the loading of the main
# configuration file or loading of the plugins is disabled.
if (!load_vimrc) || (!load_plugins)
set noloadplugins
endif
# Do not load the actual configuration file or the plugin configuration
# files if loading of the actual configuration file is disabled.
if load_vimrc
# Ensure that the runtime directory exists. The runtime directory is
# used by the main configuration file and the plugin configuration
# files to store persistent data.
if !isdirectory($MYVIMDIR .. "/runtime/")
mkdir($MYVIMDIR .. "/runtime/", "p")
endif
# Load the main configuration file.
source $MYVIMDIR/vimrc-full
# Do not load the plugin configuration files if plugins are
# disabled.
if &loadplugins
for rcfile in globpath($MYVIMDIR .. "/pack/*/config/", "*.vim", false, true, false)
execute('source ' .. rcfile)
endfor
endif
endif
# --------
# Enforce secure mode.
set secure