mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 06:30:03 +08:00
doc(core): add :h SpaceVim-options-bootstrap_after/before
Problem: there isn't doc about boostrap function. Solution: 1. add `:h SpaceVim-options-bootstrap_before` 2. and `:h SpaceVim-options-bootstrap_after` 3. update cn documentation about the differences between bootstrap_after and bootstrap_before function.
This commit is contained in:
parent
7de44bde74
commit
3a68e6ad21
@ -162,7 +162,29 @@ function! SpaceVim#custom#apply(config, type) abort
|
|||||||
call SpaceVim#logger#info(string(plugin))
|
call SpaceVim#logger#info(string(plugin))
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
""
|
||||||
|
" @section bootstrap_before, options-bootstrap_before
|
||||||
|
" @parentsection options
|
||||||
|
" set the bootstrap_before function, this function will be called when
|
||||||
|
" loading custom configuration file. for example:
|
||||||
|
" >
|
||||||
|
" [options]
|
||||||
|
" bootstrap_before = 'myspacevim#before'
|
||||||
|
" <
|
||||||
|
|
||||||
let bootstrap_before = get(options, 'bootstrap_before', '')
|
let bootstrap_before = get(options, 'bootstrap_before', '')
|
||||||
|
|
||||||
|
""
|
||||||
|
" @section bootstrap_after, options-bootstrap_after
|
||||||
|
" @parentsection options
|
||||||
|
" set the bootstrap_after function, this function will be called on
|
||||||
|
" `VimEnter` event.
|
||||||
|
" >
|
||||||
|
" [options]
|
||||||
|
" bootstrap_after = 'myspacevim#after'
|
||||||
|
" <
|
||||||
|
|
||||||
let g:_spacevim_bootstrap_after = get(options, 'bootstrap_after', '')
|
let g:_spacevim_bootstrap_after = get(options, 'bootstrap_after', '')
|
||||||
if !empty(bootstrap_before)
|
if !empty(bootstrap_before)
|
||||||
try
|
try
|
||||||
|
138
doc/SpaceVim.txt
138
doc/SpaceVim.txt
@ -20,64 +20,66 @@ CONTENTS *SpaceVim-contents*
|
|||||||
2. Options................................................|SpaceVim-options|
|
2. Options................................................|SpaceVim-options|
|
||||||
1. autocomplete_method............|SpaceVim-options-autocomplete_method|
|
1. autocomplete_method............|SpaceVim-options-autocomplete_method|
|
||||||
2. autocomplete_parens............|SpaceVim-options-autocomplete_parens|
|
2. autocomplete_parens............|SpaceVim-options-autocomplete_parens|
|
||||||
3. buffer_index_type................|SpaceVim-options-buffer_index_type|
|
3. bootstrap_after....................|SpaceVim-options-bootstrap_after|
|
||||||
4. checkinstall..........................|SpaceVim-options-checkinstall|
|
4. bootstrap_before..................|SpaceVim-options-bootstrap_before|
|
||||||
5. code_runner_focus................|SpaceVim-options-code_runner_focus|
|
5. buffer_index_type................|SpaceVim-options-buffer_index_type|
|
||||||
6. colorscheme............................|SpaceVim-options-colorscheme|
|
6. checkinstall..........................|SpaceVim-options-checkinstall|
|
||||||
7. colorscheme_bg......................|SpaceVim-options-colorscheme_bg|
|
7. code_runner_focus................|SpaceVim-options-code_runner_focus|
|
||||||
8. data_dir..................................|SpaceVim-options-data_dir|
|
8. colorscheme............................|SpaceVim-options-colorscheme|
|
||||||
9. default_custom_leader........|SpaceVim-options-default_custom_leader|
|
9. colorscheme_bg......................|SpaceVim-options-colorscheme_bg|
|
||||||
10. default_indent.....................|SpaceVim-options-default_indent|
|
10. data_dir.................................|SpaceVim-options-data_dir|
|
||||||
11. enable_bepo_layout.............|SpaceVim-options-enable_bepo_layout|
|
11. default_custom_leader.......|SpaceVim-options-default_custom_leader|
|
||||||
12. enable_cursorcolumn...........|SpaceVim-options-enable_cursorcolumn|
|
12. default_indent.....................|SpaceVim-options-default_indent|
|
||||||
13. enable_cursorline...............|SpaceVim-options-enable_cursorline|
|
13. enable_bepo_layout.............|SpaceVim-options-enable_bepo_layout|
|
||||||
14. enable_debug.........................|SpaceVim-options-enable_debug|
|
14. enable_cursorcolumn...........|SpaceVim-options-enable_cursorcolumn|
|
||||||
15. enable_googlesuggest.........|SpaceVim-options-enable_googlesuggest|
|
15. enable_cursorline...............|SpaceVim-options-enable_cursorline|
|
||||||
16. enable_guicolors.................|SpaceVim-options-enable_guicolors|
|
16. enable_debug.........................|SpaceVim-options-enable_debug|
|
||||||
17. enable_key_frequency.........|SpaceVim-options-enable_key_frequency|
|
17. enable_googlesuggest.........|SpaceVim-options-enable_googlesuggest|
|
||||||
18. enable_projects_cache.......|SpaceVim-options-enable_projects_cache|
|
18. enable_guicolors.................|SpaceVim-options-enable_guicolors|
|
||||||
19. enable_statusline_bfpath.|SpaceVim-options-enable_statusline_bfpath|
|
19. enable_key_frequency.........|SpaceVim-options-enable_key_frequency|
|
||||||
20. enable_statusline_mode.....|SpaceVim-options-enable_statusline_mode|
|
20. enable_projects_cache.......|SpaceVim-options-enable_projects_cache|
|
||||||
21. enable_statusline_tag.......|SpaceVim-options-enable_statusline_tag|
|
21. enable_statusline_bfpath.|SpaceVim-options-enable_statusline_bfpath|
|
||||||
22. enable_tabline_ft_icon.....|SpaceVim-options-enable_tabline_ft_icon|
|
22. enable_statusline_mode.....|SpaceVim-options-enable_statusline_mode|
|
||||||
23. enable_vimfiler_welcome...|SpaceVim-options-enable_vimfiler_welcome|
|
23. enable_statusline_tag.......|SpaceVim-options-enable_statusline_tag|
|
||||||
24. enable_ycm.............................|SpaceVim-options-enable_ycm|
|
24. enable_tabline_ft_icon.....|SpaceVim-options-enable_tabline_ft_icon|
|
||||||
25. error_symbol.........................|SpaceVim-options-error_symbol|
|
25. enable_vimfiler_welcome...|SpaceVim-options-enable_vimfiler_welcome|
|
||||||
26. escape_key_binding.............|SpaceVim-options-escape_key_binding|
|
26. enable_ycm.............................|SpaceVim-options-enable_ycm|
|
||||||
27. file_searching_tools.........|SpaceVim-options-file_searching_tools|
|
27. error_symbol.........................|SpaceVim-options-error_symbol|
|
||||||
28. filemanager...........................|SpaceVim-options-filemanager|
|
28. escape_key_binding.............|SpaceVim-options-escape_key_binding|
|
||||||
29. filetree_direction.............|SpaceVim-options-filetree_direction|
|
29. file_searching_tools.........|SpaceVim-options-file_searching_tools|
|
||||||
30. guifont...................................|SpaceVim-options-guifont|
|
30. filemanager...........................|SpaceVim-options-filemanager|
|
||||||
31. home_files_number...............|SpaceVim-options-home_files_number|
|
31. filetree_direction.............|SpaceVim-options-filetree_direction|
|
||||||
32. info_symbol...........................|SpaceVim-options-info_symbol|
|
32. guifont...................................|SpaceVim-options-guifont|
|
||||||
33. keep_server_alive...............|SpaceVim-options-keep_server_alive|
|
33. home_files_number...............|SpaceVim-options-home_files_number|
|
||||||
34. language.................................|SpaceVim-options-language|
|
34. info_symbol...........................|SpaceVim-options-info_symbol|
|
||||||
35. lint_engine...........................|SpaceVim-options-lint_engine|
|
35. keep_server_alive...............|SpaceVim-options-keep_server_alive|
|
||||||
36. lint_on_the_fly...................|SpaceVim-options-lint_on_the_fly|
|
36. language.................................|SpaceVim-options-language|
|
||||||
37. max_column.............................|SpaceVim-options-max_column|
|
37. lint_engine...........................|SpaceVim-options-lint_engine|
|
||||||
38. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
38. lint_on_the_fly...................|SpaceVim-options-lint_on_the_fly|
|
||||||
39. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
39. max_column.............................|SpaceVim-options-max_column|
|
||||||
40. project_auto_root...............|SpaceVim-options-project_auto_root|
|
40. plugin_bundle_dir...............|SpaceVim-options-plugin_bundle_dir|
|
||||||
41. project_rooter_outermost.|SpaceVim-options-project_rooter_outermost|
|
41. plugin_manager_processes.|SpaceVim-options-plugin_manager_processes|
|
||||||
42. project_rooter_patterns...|SpaceVim-options-project_rooter_patterns|
|
42. project_auto_root...............|SpaceVim-options-project_auto_root|
|
||||||
43. projects_cache_num.............|SpaceVim-options-projects_cache_num|
|
43. project_rooter_outermost.|SpaceVim-options-project_rooter_outermost|
|
||||||
44. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
44. project_rooter_patterns...|SpaceVim-options-project_rooter_patterns|
|
||||||
45. relativenumber.....................|SpaceVim-options-relativenumber|
|
45. projects_cache_num.............|SpaceVim-options-projects_cache_num|
|
||||||
46. retry_cnt...............................|SpaceVim-options-retry_cnt|
|
46. realtime_leader_guide.......|SpaceVim-options-realtime_leader_guide|
|
||||||
47. search_tools.........................|SpaceVim-options-search_tools|
|
47. relativenumber.....................|SpaceVim-options-relativenumber|
|
||||||
48. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
48. retry_cnt...............................|SpaceVim-options-retry_cnt|
|
||||||
49. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
49. search_tools.........................|SpaceVim-options-search_tools|
|
||||||
50. statusline_iseparator.......|SpaceVim-options-statusline_iseparator|
|
50. sidebar_width.......................|SpaceVim-options-sidebar_width|
|
||||||
51. statusline_left_sections.|SpaceVim-options-statusline_left_sections|
|
51. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
||||||
52. statusline_separator.........|SpaceVim-options-statusline_separator|
|
52. statusline_iseparator.......|SpaceVim-options-statusline_iseparator|
|
||||||
53. statusline_unicode.............|SpaceVim-options-statusline_unicode|
|
53. statusline_left_sections.|SpaceVim-options-statusline_left_sections|
|
||||||
54. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape|
|
54. statusline_separator.........|SpaceVim-options-statusline_separator|
|
||||||
55. vim_help_language...............|SpaceVim-options-vim_help_language|
|
55. statusline_unicode.............|SpaceVim-options-statusline_unicode|
|
||||||
56. vimcompatible.......................|SpaceVim-options-vimcompatible|
|
56. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape|
|
||||||
57. warning_symbol.....................|SpaceVim-options-warning_symbol|
|
57. vim_help_language...............|SpaceVim-options-vim_help_language|
|
||||||
58. windows_index_type.............|SpaceVim-options-windows_index_type|
|
58. vimcompatible.......................|SpaceVim-options-vimcompatible|
|
||||||
59. windows_leader.....................|SpaceVim-options-windows_leader|
|
59. warning_symbol.....................|SpaceVim-options-warning_symbol|
|
||||||
60. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
60. windows_index_type.............|SpaceVim-options-windows_index_type|
|
||||||
|
61. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||||
|
62. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
||||||
3. Configuration...........................................|SpaceVim-config|
|
3. Configuration...........................................|SpaceVim-config|
|
||||||
4. Commands..............................................|SpaceVim-commands|
|
4. Commands..............................................|SpaceVim-commands|
|
||||||
5. Functions............................................|SpaceVim-functions|
|
5. Functions............................................|SpaceVim-functions|
|
||||||
@ -271,6 +273,26 @@ Enable/Disable autocompletion of parentheses, default is true (enabled).
|
|||||||
autocomplete_parens = false
|
autocomplete_parens = false
|
||||||
<
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
BOOTSTRAP_AFTER *SpaceVim-options-bootstrap_after*
|
||||||
|
|
||||||
|
set the bootstrap_after function, this function will be called on `VimEnter`
|
||||||
|
event.
|
||||||
|
>
|
||||||
|
[options]
|
||||||
|
bootstrap_after = 'myspacevim#after'
|
||||||
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
BOOTSTRAP_BEFORE *SpaceVim-options-bootstrap_before*
|
||||||
|
|
||||||
|
set the bootstrap_before function, this function will be called when loading
|
||||||
|
custom configuration file. for example:
|
||||||
|
>
|
||||||
|
[options]
|
||||||
|
bootstrap_before = 'myspacevim#before'
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
BUFFER_INDEX_TYPE *SpaceVim-options-buffer_index_type*
|
BUFFER_INDEX_TYPE *SpaceVim-options-buffer_index_type*
|
||||||
|
|
||||||
|
@ -309,6 +309,9 @@ SpaceVim 默认安装了一些插件,如果需要禁用某个插件,可以
|
|||||||
bootstrap_after = "myspacevim#after"
|
bootstrap_after = "myspacevim#after"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
这两种启动函数的区别在于,`bootstrap_before`函数是在载入用户配置时候执行的,
|
||||||
|
而`bootstrap_after`函数是在触发`VimEnter`事件时执行的。
|
||||||
|
|
||||||
启动函数文件应放置在 Vim &runtimepath 的 autoload 文件夹内。例如:
|
启动函数文件应放置在 Vim &runtimepath 的 autoload 文件夹内。例如:
|
||||||
|
|
||||||
文件名:`~/.SpaceVim.d/autoload/myspacevim.vim`
|
文件名:`~/.SpaceVim.d/autoload/myspacevim.vim`
|
||||||
|
Loading…
Reference in New Issue
Block a user