What is layer - liuchengxu/space-vim GitHub Wiki
Space-vim uses the Layer concept to organize some useful vim configuration fragments, which originated from spacemacs.
├── layers
└── +lang
└── python
├── README.md
├── config.vim
└── packages.vim
All the layers are populated under layers/+foo directory, where +foo is called a topic here, e.g., +lang.
Each layer, e.g., python, has parallel composition.
example:
MP 'tmhedberg/SimpylFold'
MP 'python-mode/python-mode'Add some necessary vim plugins to obtain the layer's functionality.
vim-plug is used as vim plugin manager in space-vim. In each packages.vim, command MP is used to add a vim plugin, which is same as command Plug . As a matter of fact, MP is nothing but a wrapper of Plug for the added option exclude in space-vim.
example:
" python-mode {
let g:pymode_lint_checkers = ['pyflakes']
let g:pymode_trim_whitespaces = 0
let g:pymode_options = 0
let g:pymode_rope = 0
let g:pymode_indent = 1
let g:pymode_folding = 0
let g:pymode_options_colorcolumn = 1
let g:pymode_breakpoint_bind = '<leader>br'
if spacevim#LayerLoaded('syntax-checking')
let g:pymode_lint = 0
endif
" }Add some layer-specific settings, in other words, configurations related to the plugins added in packages.vim.
A brief description for the layer, take this as an example.
If you want to enable a certain Layer, extend g:spacevim_layers in .spacevim:
let g:spacevim_layers = [
\ 'fzf', 'unite', 'better-defaults',
\ 'which-key',
\ 'python',
\ ]If you want to add a new Layer:
-
choose a topic (or new a topic) +foo and create a directory with the above three Layer components
new-layerin layers/+foo/new-layer directory. -
Then run
:LayerCache, space-vim will update/cache the layers' information. In order to avoid scanning the layers directory every time when you open vim, the required information has been cached incore/autoload/spacevim/info.vim. -
Add
new-layertog:spacevim_layers
let g:spacevim_layers = [
\ 'fzf', 'unite', 'better-defaults',
\ 'which-key',
\ 'python',
\ 'new-layer',
\ ]