diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 5259bc3e8..9929c8288 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -498,6 +498,7 @@ let g:spacevim_colorscheme_default = 'desert' let g:spacevim_simple_mode = 0 "" " The default file manager of SpaceVim. Default is 'vimfiler'. +" you can also use nerdtree or defx let g:spacevim_filemanager = 'vimfiler' let g:spacevim_sidebar_direction = '' @@ -685,6 +686,7 @@ let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default'] let g:spacevim_smartcloseignoreft = [ \ 'tagbar', \ 'vimfiler', + \ 'defx', \ 'SpaceVimRunner', \ 'SpaceVimREPL', \ 'SpaceVimQuickFix', @@ -963,6 +965,9 @@ function! SpaceVim#welcome() abort if exists(':VimFiler') == 2 VimFiler wincmd p + elseif exists(':Defx') == 2 + Defx + wincmd p endif endif endfunction diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index 11a0a45d2..367584cc8 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -17,6 +17,8 @@ function! SpaceVim#layers#core#plugins() abort call add(plugins, ['Shougo/vimfiler.vim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1, 'on_cmd' : ['VimFiler', 'VimFilerBufferDir']}]) call add(plugins, ['Shougo/unite.vim',{ 'merged' : 0 , 'loadconf' : 1}]) call add(plugins, ['Shougo/vimproc.vim', {'build' : [(executable('gmake') ? 'gmake' : 'make')]}]) + elseif g:spacevim_filemanager ==# 'defx' + call add(plugins, ['Shougo/defx.nvim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}]) endif if !g:spacevim_vimcompatible @@ -183,6 +185,12 @@ function! SpaceVim#layers#core#config() abort call SpaceVim#mapping#space#def('nnoremap', ['f', 'T'], 'NERDTree', 'show_file_tree', 1) call SpaceVim#mapping#space#def('nnoremap', ['f', 'o'], 'NERDTreeFind', 'open_file_tree', 1) call SpaceVim#mapping#space#def('nnoremap', ['b', 't'], 'NERDTree %', 'show_file_tree_at_buffer_dir', 1) + elseif g:spacevim_filemanager ==# 'defx' + " TODO: fix all these command + call SpaceVim#mapping#space#def('nnoremap', ['f', 't'], 'Defx', 'toggle_file_tree', 1) + call SpaceVim#mapping#space#def('nnoremap', ['f', 'T'], 'Defx -no-toggle', 'show_file_tree', 1) + call SpaceVim#mapping#space#def('nnoremap', ['f', 'o'], 'Defx -find', 'open_file_tree', 1) + call SpaceVim#mapping#space#def('nnoremap', ['b', 't'], 'Defx -no-toggle', 'show_file_tree_at_buffer_dir', 1) endif call SpaceVim#mapping#space#def('nnoremap', ['f', 'y'], 'call zvim#util#CopyToClipboard()', 'show-and-copy-buffer-filename', 1) let g:_spacevim_mappings_space.f.v = {'name' : '+Vim(SpaceVim)'} diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 21c19ab22..c9bb07dd4 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -351,6 +351,9 @@ function! SpaceVim#layers#core#statusline#get(...) abort \ . '%#SpaceVim_statusline_b#' \ . ' vimfiler %#SpaceVim_statusline_b_SpaceVim_statusline_c#' \ . s:lsep + elseif &filetype ==# 'defx' + return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep + \ . '%#SpaceVim_statusline_b# defx %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' ' elseif &filetype ==# 'gista-list' return '%#SpaceVim_statusline_ia#' \ . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' diff --git a/autoload/zvim.vim b/autoload/zvim.vim index 7748ca990..930d60e7a 100644 --- a/autoload/zvim.vim +++ b/autoload/zvim.vim @@ -114,4 +114,4 @@ function! s:search_line(path, term) abort "{{{ return 0 endfunction "}}} -" vim:set et sw=2: +" vim:set et sw=2 cc=80 nowrap: diff --git a/autoload/zvim/plug.vim b/autoload/zvim/plug.vim index eb89e9c3d..ac9af7973 100644 --- a/autoload/zvim/plug.vim +++ b/autoload/zvim/plug.vim @@ -1,216 +1,218 @@ let s:save_cpo = &cpo set cpo&vim function! s:install_manager() abort - " Fsep && Psep - if has('win16') || has('win32') || has('win64') - let s:Psep = ';' - let s:Fsep = '\' + " Fsep && Psep + if has('win16') || has('win32') || has('win64') + let s:Psep = ';' + let s:Fsep = '\' + else + let s:Psep = ':' + let s:Fsep = '/' + endif + " auto install plugin manager + if g:spacevim_plugin_manager ==# 'neobundle' + "auto install neobundle + if filereadable(expand(g:spacevim_plugin_bundle_dir) + \ . 'neobundle.vim'. s:Fsep. 'README.md') + let g:_spacevim_neobundle_installed = 1 else - let s:Psep = ':' - let s:Fsep = '/' + if executable('git') + exec '!git clone ' + \ .'https://github.com/' + \ .'Shougo/neobundle.vim' + \ . ' ' + \ . fnameescape(g:spacevim_plugin_bundle_dir) + \ . 'neobundle.vim' + let g:_spacevim_neobundle_installed = 1 + else + echohl WarningMsg + echom 'You need install git!' + echohl None + endif endif - " auto install plugin manager - if g:spacevim_plugin_manager ==# 'neobundle' - "auto install neobundle - if filereadable(expand(g:spacevim_plugin_bundle_dir) - \ . 'neobundle.vim'. s:Fsep. 'README.md') - let g:_spacevim_neobundle_installed = 1 - else - if executable('git') - exec '!git clone ' - \ .'https://github.com/' - \ .'Shougo/neobundle.vim' - \ . ' ' - \ . fnameescape(g:spacevim_plugin_bundle_dir) - \ . 'neobundle.vim' - let g:_spacevim_neobundle_installed = 1 - else - echohl WarningMsg - echom 'You need install git!' - echohl None - endif - endif - exec 'set runtimepath+=' - \ . fnameescape(g:spacevim_plugin_bundle_dir) - \ . 'neobundle.vim' - elseif g:spacevim_plugin_manager ==# 'dein' - "auto install dein - if filereadable(expand(g:spacevim_plugin_bundle_dir) - \ . join(['repos', 'github.com', - \ 'Shougo', 'dein.vim', 'README.md'], - \ s:Fsep)) - let g:_spacevim_dein_installed = 1 - else - if executable('git') - exec '!git clone https://github.com/Shougo/dein.vim "' - \ . expand(g:spacevim_plugin_bundle_dir) - \ . join(['repos', 'github.com', - \ 'Shougo', 'dein.vim"'], s:Fsep) - let g:_spacevim_dein_installed = 1 - else - echohl WarningMsg - echom 'You need install git!' - echohl None - endif - endif - exec 'set runtimepath+='. fnameescape(g:spacevim_plugin_bundle_dir) - \ . join(['repos', 'github.com', 'Shougo', - \ 'dein.vim'], s:Fsep) - elseif g:spacevim_plugin_manager ==# 'vim-plug' - "auto install vim-plug - if filereadable(expand('~/.cache/vim-plug/autoload/plug.vim')) - let g:_spacevim_vim_plug_installed = 1 - else - if executable('curl') - exec '!curl -fLo ' - \ . '~/.cache/vim-plug/autoload/plug.vim' - \ . ' --create-dirs ' - \ . 'https://raw.githubusercontent.com/' - \ . 'junegunn/vim-plug/master/plug.vim' - let g:_spacevim_vim_plug_installed = 1 - else - echohl WarningMsg - echom 'You need install curl!' - echohl None - endif - endif - exec 'set runtimepath+=~/.cache/vim-plug/' + exec 'set runtimepath+=' + \ . fnameescape(g:spacevim_plugin_bundle_dir) + \ . 'neobundle.vim' + elseif g:spacevim_plugin_manager ==# 'dein' + "auto install dein + if filereadable(expand(g:spacevim_plugin_bundle_dir) + \ . join(['repos', 'github.com', + \ 'Shougo', 'dein.vim', 'README.md'], + \ s:Fsep)) + let g:_spacevim_dein_installed = 1 + else + if executable('git') + exec '!git clone https://github.com/Shougo/dein.vim "' + \ . expand(g:spacevim_plugin_bundle_dir) + \ . join(['repos', 'github.com', + \ 'Shougo', 'dein.vim"'], s:Fsep) + let g:_spacevim_dein_installed = 1 + else + echohl WarningMsg + echom 'You need install git!' + echohl None + endif endif + exec 'set runtimepath+='. fnameescape(g:spacevim_plugin_bundle_dir) + \ . join(['repos', 'github.com', 'Shougo', + \ 'dein.vim'], s:Fsep) + elseif g:spacevim_plugin_manager ==# 'vim-plug' + "auto install vim-plug + if filereadable(expand('~/.cache/vim-plug/autoload/plug.vim')) + let g:_spacevim_vim_plug_installed = 1 + else + if executable('curl') + exec '!curl -fLo ' + \ . '~/.cache/vim-plug/autoload/plug.vim' + \ . ' --create-dirs ' + \ . 'https://raw.githubusercontent.com/' + \ . 'junegunn/vim-plug/master/plug.vim' + let g:_spacevim_vim_plug_installed = 1 + else + echohl WarningMsg + echom 'You need install curl!' + echohl None + endif + endif + exec 'set runtimepath+=~/.cache/vim-plug/' + endif endf if get(g:,'spacevim_enable_plugins', 1) - call s:install_manager() + call s:install_manager() endif function! zvim#plug#begin(path) abort - let g:unite_source_menu_menus.AddedPlugins = - \ {'description': - \ 'All the Added plugins' - \ . ' lp'} - let g:unite_source_menu_menus.AddedPlugins.command_candidates = [] - nnoremap lp :Unite -silent - \ -winheight=17 -start-insert menu:AddedPlugins - if g:spacevim_plugin_manager ==# 'neobundle' - call neobundle#begin(a:path) - elseif g:spacevim_plugin_manager ==# 'dein' - call dein#begin(a:path) - elseif g:spacevim_plugin_manager ==# 'vim-plug' - call plug#begin(a:path) - endif + let g:unite_source_menu_menus.AddedPlugins = + \ {'description': + \ 'All the Added plugins' + \ . ' lp'} + let g:unite_source_menu_menus.AddedPlugins.command_candidates = [] + nnoremap lp :Unite -silent + \ -winheight=17 -start-insert menu:AddedPlugins + if g:spacevim_plugin_manager ==# 'neobundle' + call neobundle#begin(a:path) + elseif g:spacevim_plugin_manager ==# 'dein' + call dein#begin(a:path) + elseif g:spacevim_plugin_manager ==# 'vim-plug' + call plug#begin(a:path) + endif endfunction function! zvim#plug#end() abort - if g:spacevim_plugin_manager ==# 'neobundle' - call neobundle#end() - if g:spacevim_checkinstall == 1 - silent! let g:_spacevim_checking_flag = neobundle#exists_not_installed_bundles() - if g:_spacevim_checking_flag - augroup SpaceVimCheckInstall - au! - au VimEnter * SPInstall - augroup END - endif - endif - elseif g:spacevim_plugin_manager ==# 'dein' - call dein#end() - if g:spacevim_checkinstall == 1 - silent! let g:_spacevim_checking_flag = dein#check_install() - if g:_spacevim_checking_flag - augroup SpaceVimCheckInstall - au! - au VimEnter * SPInstall - augroup END - endif - endif - call dein#call_hook('source') - elseif g:spacevim_plugin_manager ==# 'vim-plug' - call plug#end() + if g:spacevim_plugin_manager ==# 'neobundle' + call neobundle#end() + if g:spacevim_checkinstall == 1 + silent! let g:_spacevim_checking_flag = neobundle#exists_not_installed_bundles() + if g:_spacevim_checking_flag + augroup SpaceVimCheckInstall + au! + au VimEnter * SPInstall + augroup END + endif endif + elseif g:spacevim_plugin_manager ==# 'dein' + call dein#end() + if g:spacevim_checkinstall == 1 + silent! let g:_spacevim_checking_flag = dein#check_install() + if g:_spacevim_checking_flag + augroup SpaceVimCheckInstall + au! + au VimEnter * SPInstall + augroup END + endif + endif + call dein#call_hook('source') + elseif g:spacevim_plugin_manager ==# 'vim-plug' + call plug#end() + endif endfunction function! zvim#plug#defind_hooks(bundle) abort - if g:spacevim_plugin_manager ==# 'neobundle' - let s:hooks = neobundle#get_hooks(a:bundle) - func! s:hooks.on_source(bundle) abort - call zvim#util#source_rc('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim') - endf - elseif g:spacevim_plugin_manager ==# 'dein' - call dein#config(g:dein#name, { - \ 'hook_source' : "call zvim#util#source_rc('plugins/" . split(g:dein#name,'\.')[0] . ".vim')" - \ }) - endif + if g:spacevim_plugin_manager ==# 'neobundle' + let s:hooks = neobundle#get_hooks(a:bundle) + func! s:hooks.on_source(bundle) abort + call zvim#util#source_rc('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim') + endf + elseif g:spacevim_plugin_manager ==# 'dein' + call dein#config(g:dein#name, { + \ 'hook_source' : "call zvim#util#source_rc('plugins/" . split(g:dein#name,'\.')[0] . ".vim')" + \ }) + endif endfunction function! zvim#plug#fetch() abort - if g:spacevim_plugin_manager ==# 'neobundle' - NeoBundleFetch 'Shougo/neobundle.vim' - elseif g:spacevim_plugin_manager ==# 'dein' - call dein#add('Shougo/dein.vim') - endif + if g:spacevim_plugin_manager ==# 'neobundle' + NeoBundleFetch 'Shougo/neobundle.vim' + elseif g:spacevim_plugin_manager ==# 'dein' + call dein#add('Shougo/dein.vim') + endif endfunction let s:plugins = [] fu! s:parser(args) abort - return a:args + return a:args endf let g:_spacevim_plugins = [] function! zvim#plug#add(repo,...) abort - let g:spacevim_plugin_name = '' - if g:spacevim_plugin_manager ==# 'neobundle' - exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',') - let g:spacevim_plugin_name = split(a:repo, '/')[-1] - elseif g:spacevim_plugin_manager ==# 'dein' - if len(a:000) > 0 - call dein#add(a:repo,s:parser(a:000[0])) - else - call dein#add(a:repo) - endif - let g:spacevim_plugin_name = g:dein#name - call add(g:_spacevim_plugins, g:dein#name) - elseif g:spacevim_plugin_manager ==# 'vim-plug' - if len(a:000) > 0 - exec "Plug '".a:repo."', ".join(a:000,',') - else - exec "Plug '".a:repo."'" - endif - let g:spacevim_plugin_name = split(a:repo, '/')[-1] + let g:spacevim_plugin_name = '' + if g:spacevim_plugin_manager ==# 'neobundle' + exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',') + let g:spacevim_plugin_name = split(a:repo, '/')[-1] + elseif g:spacevim_plugin_manager ==# 'dein' + if len(a:000) > 0 + call dein#add(a:repo,s:parser(a:000[0])) + else + call dein#add(a:repo) endif - let str = get(g:,'_spacevim_plugin_layer', 'custom plugin') - let str = '[' . str . ']' - let str = str . repeat(' ', 25 - len(str)) - exec 'call add(g:unite_source_menu_menus' - \ . '.AddedPlugins.command_candidates, ["'. str . '[' - \ . a:repo - \ . (len(a:000) > 0 ? (']' - \ . repeat(' ', 40 - len(a:repo)) - \ . '[lazy loaded] [' . string(a:000[0])) : '') - \ . ']","OpenBrowser https://github.com/' - \ . a:repo - \ . '"])' - call add(s:plugins, a:repo) + let g:spacevim_plugin_name = g:dein#name + call add(g:_spacevim_plugins, g:dein#name) + elseif g:spacevim_plugin_manager ==# 'vim-plug' + if len(a:000) > 0 + exec "Plug '".a:repo."', ".join(a:000,',') + else + exec "Plug '".a:repo."'" + endif + let g:spacevim_plugin_name = split(a:repo, '/')[-1] + endif + let str = get(g:,'_spacevim_plugin_layer', 'custom plugin') + let str = '[' . str . ']' + let str = str . repeat(' ', 25 - len(str)) + exec 'call add(g:unite_source_menu_menus' + \ . '.AddedPlugins.command_candidates, ["'. str . '[' + \ . a:repo + \ . (len(a:000) > 0 ? (']' + \ . repeat(' ', 40 - len(a:repo)) + \ . '[lazy loaded] [' . string(a:000[0])) : '') + \ . ']","OpenBrowser https://github.com/' + \ . a:repo + \ . '"])' + call add(s:plugins, a:repo) endfunction function! zvim#plug#tap(plugin) abort - if g:spacevim_plugin_manager ==# 'neobundle' - return neobundle#tap(a:plugin) - elseif g:spacevim_plugin_manager ==# 'dein' - return dein#tap(a:plugin) - endif + if g:spacevim_plugin_manager ==# 'neobundle' + return neobundle#tap(a:plugin) + elseif g:spacevim_plugin_manager ==# 'dein' + return dein#tap(a:plugin) + endif endfunction function! zvim#plug#enable_plug() abort - return g:_spacevim_neobundle_installed - \ || g:_spacevim_dein_installed - \ || g:_spacevim_vim_plug_installed + return g:_spacevim_neobundle_installed + \ || g:_spacevim_dein_installed + \ || g:_spacevim_vim_plug_installed endfunction function! zvim#plug#loadPluginBefore(plugin) abort - if matchend(a:plugin, '.vim') == len(a:plugin) - call zvim#util#source_rc('plugins_before/' . a:plugin) - else - call zvim#util#source_rc('plugins_before/' . a:plugin . '.vim') - endif + if matchend(a:plugin, "\\.vim") == len(a:plugin) + call zvim#util#source_rc('plugins_before/' . a:plugin) + elseif matchend(a:plugin, "\\.nvim") == len(a:plugin) + call zvim#util#source_rc('plugins_before/' . a:plugin[:-6] . '.vim') + else + call zvim#util#source_rc('plugins_before/' . a:plugin . '.vim') + endif endfunction let &cpo = s:save_cpo diff --git a/config/plugins/defx.vim b/config/plugins/defx.vim new file mode 100644 index 000000000..4bbfa42b6 --- /dev/null +++ b/config/plugins/defx.vim @@ -0,0 +1,145 @@ +"============================================================================= +" defx.vim --- defx config +" Copyright (c) 2016-2017 Wang Shidong & Contributors +" Author: Wang Shidong < wsdjeg at 163.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + +" defx supported is added in https://github.com/SpaceVim/SpaceVim/pull/2282 + +let s:SYS = SpaceVim#api#import('system') + +call defx#custom#option('_', { + \ 'winwidth': g:spacevim_sidebar_width, + \ 'split': 'vertical', + \ 'direction': 'botright', + \ 'show_ignored_files': 0, + \ 'buffer_name': '', + \ 'toggle': 1, + \ 'resume': 1 + \ }) + +call defx#custom#column('mark', { + \ 'readonly_icon': '', + \ 'selected_icon': '', + \ }) + +call defx#custom#column('filename', { + \ 'directory_icon': '', + \ 'opened_icon': '', + \ }) + +augroup vfinit + au! + autocmd FileType defx call s:defx_init() + " auto close last defx windows + " autocmd BufEnter * nested if (!has('vim_starting') + " \ && winnr('$') == 1 && &filetype ==# 'vimfiler') | + " \ q | endif +augroup END + +function! s:defx_init() + setl nonumber + setl norelativenumber + setl listchars= + + silent! nunmap + silent! nunmap + silent! nunmap + silent! nunmap E + silent! nunmap gr + silent! nunmap gf + silent! nunmap - + silent! nunmap s + + " nnoremap st vimfiler#do_action('tabswitch') + " nnoremap yY :call copy_to_system_clipboard() + nnoremap ' + \ defx#do_action('toggle_select') . 'j' + " TODO: we need an action to clear all selections + nnoremap V + \ defx#do_action('toggle_select_all') + " nmap v (vimfiler_quick_look) + " nmap p (vimfiler_preview_file) + " nmap i (vimfiler_switch_to_history_directory) + + " Define mappings + nnoremap gx + \ defx#do_action('execute_system') + nnoremap yy + \ defx#do_action('copy') + nnoremap q + \ defx#do_action('quit') + nnoremap m + \ defx#do_action('move') + nnoremap P + \ defx#do_action('paste') + nnoremap h defx#do_action('call', 'DefxSmartH') + nnoremap defx#do_action('call', 'DefxSmartH') + nnoremap l + \ defx#is_directory() ? + \ defx#do_action('open_tree') . 'j' : defx#do_action('open') + nnoremap + \ defx#is_directory() ? + \ defx#do_action('open_tree') . 'j' : defx#do_action('open') + nnoremap + \ defx#is_directory() ? + \ defx#do_action('open_directory') : defx#do_action('drop') + nnoremap <2-LeftMouse> + \ defx#is_directory() ? + \ defx#do_action('open_tree') : defx#do_action('drop') + nnoremap sg + \ defx#do_action('drop', 'vsplit') + nnoremap sv + \ defx#do_action('drop', 'split') + nnoremap p + \ defx#do_action('open', 'pedit') + nnoremap N + \ defx#do_action('new_file') + nnoremap d + \ defx#do_action('remove') + nnoremap r + \ defx#do_action('rename') + nnoremap yy + \ defx#do_action('yank_path') + nnoremap . + \ defx#do_action('toggle_ignored_files') + nnoremap ~ + \ defx#do_action('cd') + nnoremap j + \ line('.') == line('$') ? 'gg' : 'j' + nnoremap k + \ line('.') == 1 ? 'G' : 'k' + nnoremap + \ defx#do_action('redraw') + nnoremap + \ defx#do_action('print') + nnoremap cd + \ defx#do_action('change_vim_cwd') +endf + +function! DefxSmartH(_) + " candidate is opend tree? + if defx#is_opened_tree() + return defx#call_action('close_tree') + endif + + " parent is root? + let s:candidate = defx#get_candidate() + let s:parent = fnamemodify(s:candidate['action__path'], s:candidate['is_directory'] ? ':p:h:h' : ':p:h') + let sep = s:SYS.isWindows ? '\\' : '/' + if s:trim_right(s:parent, sep) == s:trim_right(b:defx.paths[0], sep) + return defx#call_action('cd', ['..']) + endif + + " move to parent. + call defx#call_action('search', s:parent) + + " if you want close_tree immediately, enable below line. + call defx#call_action('close_tree') +endfunction + +function! s:trim_right(str, trim) + return substitute(a:str, printf('%s$', a:trim), '', 'g') +endfunction diff --git a/config/plugins_before/defx.vim b/config/plugins_before/defx.vim new file mode 100644 index 000000000..60eaf2269 --- /dev/null +++ b/config/plugins_before/defx.vim @@ -0,0 +1,2 @@ +nnoremap :Defx + diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index cdd2baf11..547815f16 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -566,7 +566,8 @@ plugins will be installed. < *g:spacevim_filemanager* -The default file manager of SpaceVim. Default is 'vimfiler'. +The default file manager of SpaceVim. Default is 'vimfiler'. you can also use +nerdtree or defx *g:spacevim_plugin_manager_processes* Set the max process of SpaceVim plugin manager diff --git a/docs/layers/lang/markdown.md b/docs/layers/lang/markdown.md index d5d8fbb67..f5701bd62 100644 --- a/docs/layers/lang/markdown.md +++ b/docs/layers/lang/markdown.md @@ -33,6 +33,7 @@ To use this configuration layer, update custom configuration file with: SpaceVim uses remark to format Markdown file by default, but we suggest using [Prettier](https://github.com/prettier/prettier) on Windows. You can install remark via [npm](https://www.npmjs.com/get-npm), the commands are shown as below. + ```sh npm -g install remark npm -g install remark-cli @@ -42,10 +43,13 @@ npm -g install remark-stringify You can install [Prettier](https://github.com/prettier/prettier) via [yarn](https://yarnpkg.com/lang/zh-hans/docs/install/#windows-stable) or [npm](https://www.npmjs.com/get-npm), the commands are shown as below: 1. Via `yarn` + ```sh yarn global add prettier ``` + 2. Via `npm` + ```sh npm install --global prettier ```