1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:20:04 +08:00

feat(lua): add lua layer modular

This commit is contained in:
wsdjeg 2022-06-16 23:38:10 +08:00
parent efbaf95575
commit 8c11a360c6

View File

@ -28,5 +28,24 @@ function M.isLoaded(layer)
return sp.call('SpaceVim#layers#isLoaded', layer) == 1
end
local function list_layers()
vim.cmd('tabnew SpaceVimLayers')
vim.cmd('nnoremap <buffer> q :q<cr>')
vim.cmd('setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell')
vim.cmd('setf SpaceVimLayerManager')
vim.cmd('nnoremap <silent> <buffer> q :bd<CR>')
local info = {'SpaceVim layers:', ''}
-- call setline(1,info + s:find_layers())
vim.cmd('setl nomodifiable')
end
function M.load(layer, ...)
if layer == '-l' then
list_layers()
return
end
end
return M