mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 07:40:05 +08:00
Add npm support for building 2 plugins (#3154)
This commit is contained in:
parent
e3ab2f4f7e
commit
2f38a08f78
@ -25,13 +25,22 @@ function! SpaceVim#layers#lang#markdown#plugins() abort
|
|||||||
call add(plugins, ['joker1007/vim-markdown-quote-syntax',{ 'on_ft' : 'markdown'}])
|
call add(plugins, ['joker1007/vim-markdown-quote-syntax',{ 'on_ft' : 'markdown'}])
|
||||||
call add(plugins, ['mzlogin/vim-markdown-toc',{ 'on_ft' : 'markdown'}])
|
call add(plugins, ['mzlogin/vim-markdown-toc',{ 'on_ft' : 'markdown'}])
|
||||||
call add(plugins, ['iamcco/mathjax-support-for-mkdp',{ 'on_ft' : 'markdown'}])
|
call add(plugins, ['iamcco/mathjax-support-for-mkdp',{ 'on_ft' : 'markdown'}])
|
||||||
|
call add(plugins, ['lvht/tagbar-markdown',{'merged' : 0}])
|
||||||
|
" check node package managers to ensure building of 2 plugins below
|
||||||
|
if executable('npm')
|
||||||
|
let s:node_pkgm = 'npm'
|
||||||
|
elseif executable('yarn')
|
||||||
|
let s:node_pkgm = 'yarn'
|
||||||
|
else
|
||||||
|
let s:node_pkgm = ''
|
||||||
|
call SpaceVim#logger#error('npm or yarn is required to build iamcco/markdown-preview and neoclide/vim-node-rpc')
|
||||||
|
endif
|
||||||
call add(plugins, ['iamcco/markdown-preview.nvim',
|
call add(plugins, ['iamcco/markdown-preview.nvim',
|
||||||
\ { 'on_ft' : 'markdown',
|
\ { 'on_ft' : 'markdown',
|
||||||
\ 'depends': 'open-browser.vim',
|
\ 'depends': 'open-browser.vim',
|
||||||
\ 'build' : 'cd app & yarn install' }])
|
\ 'build' : 'cd app & ' . s:node_pkgm . ' install' }])
|
||||||
call add(plugins, ['lvht/tagbar-markdown',{'merged' : 0}])
|
|
||||||
if !has('nvim')
|
if !has('nvim')
|
||||||
call add(plugins, ['neoclide/vim-node-rpc', {'merged': 0, 'build' : 'yarn install'}])
|
call add(plugins, ['neoclide/vim-node-rpc', {'merged': 0, 'build' : s:node_pkgm . ' install'}])
|
||||||
endif
|
endif
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user