-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path.vimrc
88 lines (64 loc) · 2.36 KB
/
.vimrc
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
"
" WebVim Configuration entry point
"
" author: Bertrand Chevrier <[email protected]>
" source: https://github.com/krampstudio/dotvim
" year : 2015
"
" You won't find any configuration here directly,
" please look at files under the config folder for global config
" and under plugins for plugins configuration
filetype plugin on
let g:vimDir = $HOME.'/.vim'
let g:hardcoreMode = 1
let s:pluginDir = g:vimDir.'/plugins/plugged'
let s:pluginDef = g:vimDir.'/plugins/def.vim'
let s:pluginConf = g:vimDir.'/plugins/config.vim'
let s:configSetting = g:vimDir.'/config/setting.vim'
let s:configMapping = g:vimDir.'/config/mapping.vim'
let s:configAbbrev = g:vimDir.'/config/abbrev.vim'
let s:configAutocmd = g:vimDir.'/config/autocmd.vim'
let s:userConfig = g:vimDir.'/local.vim'
if !isdirectory(s:pluginDir)
" Welcome message when plugins are not yet installed
echom " "
echom "Welcome to WebVim"
echom " > the vim IDE for web dev <"
echom " "
echom "Checking dependencies :"
if (!executable('node') && !executable('nodejs')) || !executable('npm')
echom " [ERR] node.js and npm are required, please install them before continuing."
echom " "
else
echom " - nodejs : ok"
echom " - npm : ok"
echom " - eslint : " . (executable('eslint') ? "ok" : "no (optional)")
echom " - jsonlint : " . (executable('jsonlint') ? "ok" : "no (optional)")
echom " - csslint : " . (executable('csslint') ? "ok" : "no (optional)")
echom " done."
echom " "
echom "We are going to install the plugins : "
echom " 1. take a coffee"
echom " 2. reload vim"
echom " 3. Envoy WebVim"
echom " "
echom "Please note if you want to have the arrows keys and <esc>, disable the 'hardcoreMode' in the vimrc"
echom " "
exec ":source ".s:pluginDef
"Install plugins on first run
autocmd VimEnter * PlugInstall
endif
else
" Loads the global config, mapping and settings
exec ":source ".s:configSetting
exec ":source ".s:configMapping
exec ":source ".s:configAbbrev
exec ":source ".s:configAutocmd
" Loads plugins def and config
exec ":source ".s:pluginDef
exec ":source ".s:pluginConf
" user configuration
if filereadable(s:userConfig)
exec ":source ".s:userConfig
endif
endif