1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

fix(vim): fix vim supporting

close https://github.com/SpaceVim/SpaceVim/issues/4628
This commit is contained in:
wsdjeg 2022-04-08 12:55:28 +08:00
parent 17ff71f45c
commit 2452a1e86a
3 changed files with 15 additions and 12 deletions

View File

@ -148,11 +148,12 @@ function! s:apply(config, type) abort
let layers = get(a:config, 'layers', [])
for layer in layers
let enable = get(layer, 'enable', 1)
let name = get(layer, 'name', '')
if (type(enable) == type('') && !eval(enable))
\ || (type(enable) != type('') && !enable)
call SpaceVim#layers#disable(layer.name)
call SpaceVim#layers#disable(name)
else
call SpaceVim#layers#load(layer.name, layer)
call SpaceVim#layers#load(name, layer)
endif
endfor
let custom_plugins = get(a:config, 'custom_plugins', [])

View File

@ -66,6 +66,8 @@ function! SpaceVim#layers#load(layer, ...) abort
if a:layer ==# '-l'
call s:list_layers()
return
elseif empty(a:layer) || type(a:layer) !=# type('')
return
endif
let loadable = 1
try

View File

@ -6,6 +6,16 @@
" License: GPLv3
"=============================================================================
" set default encoding to utf-8
" Let Vim use utf-8 internally, because many scripts require this
set encoding=utf-8
scriptencoding utf-8
" Enable nocompatible
if &compatible
set nocompatible
endif
let g:_spacevim_root_dir = escape(fnamemodify(resolve(fnamemodify(expand('<sfile>'),
\ ':p:h:gs?\\?'.((has('win16') || has('win32')
\ || has('win64'))?'\':'/') . '?')), ':p:gs?[\\/]?/?'), ' ')
@ -22,17 +32,7 @@ else
endif
call SpaceVim#logger#info('Loading SpaceVim from: ' . g:_spacevim_root_dir)
" Enable nocompatible
if has('vim_starting')
" set default encoding to utf-8
" Let Vim use utf-8 internally, because many scripts require this
set encoding=utf-8
scriptencoding utf-8
if &compatible
" compatible mode is not supported in SpaceVim
set nocompatible
endif
" python host
if !empty($PYTHON_HOST_PROG)
let g:python_host_prog = $PYTHON_HOST_PROG