-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
29 lines (22 loc) · 958 Bytes
/
init.vim
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
" Executes if/else clause for setting defaults on env vars.
" Will probably move this to Lua at some point.
fun! SetDefault(env_name, glob_path)
let l:var_assignment = 'let g:' . tolower(a:env_name) . ' = '
let l:if_clause = 'if empty($' . a:env_name . ')'
let l:then_scope = var_assignment . 'glob("' . a:glob_path . '")'
let l:else_scope = var_assignment . '$' . a:env_name
exec l:if_clause . ' | ' . l:then_scope . ' | else | ' . l:else_scope . ' | endif'
endfun
fun! SetWith(set_name, set_value)
let l:lhs_expr = 'set ' . a:set_name
exec l:lhs_expr . '=' . a:set_value
endfun
call SetDefault('XDG_CONFIG_HOME', $HOME . '/.config')
call SetDefault('XDG_CACHE_HOME', $HOME . '/.cache')
call SetDefault('NVIM_DIR', g:xdg_config_home . '/nvim')
call SetDefault('NVIM_CACHE_DIR', g:xdg_cache_home . '/nvim')
lua require('init')
for module in glob(g:nvim_dir . '/config/*.vim', 0, 1)
exec 'so' module
endfor
let g:omni_sql_no_default_maps = 1