From b2a354c0ad971db5c00479ddbe1096ef4795e653 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 19 Jun 2024 20:43:09 +0800 Subject: [PATCH] docs(help): update help SpaceVim-options --- autoload/SpaceVim.vim | 79 ++++++++++++++++++++++++++++++++++++------ doc/SpaceVim.txt | 80 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 140 insertions(+), 19 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index cba82c122..2de055a9a 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -32,18 +32,77 @@ scriptencoding utf-8 "" " @section Options, options -" SpaceVim uses `~/.SpaceVim.d/init.toml` as its default global config file. -" You can set all the SpaceVim options and layers in it. `~/.SpaceVim.d/` will -" also be added to runtimepath, so you can write your own scripts in it. -" SpaceVim also supports local config for each project. Place local config -" settings in `.SpaceVim.d/init.toml` in the root directory of your project. -" `.SpaceVim.d/` will also be added to runtimepath. -" -" here is an example setting SpaceVim options: +" The very first time SpaceVim starts up, it will ask you to choose a mode, +" `basic mode` or `dark powered mode`. Then it will create a +" `.SpaceVim.d/init.toml` file in your $HOME directory. +" All the user configuration files are stored in ~/.SpaceVim.d/ directory. +" +" `~/.SpaceVim.d/` will also be added to |'runtimepath'|. +" +" It is also possible to override the location of `~/.SpaceVim.d/` by +" using the environment variable `$SPACEVIMDIR`. +" Of course, symlinks can be used to change the location of this directory. +" +" SpaceVim also supports project specific configuration files. +" The project configuration file is `.SpaceVim.d/init.toml` in the root of +" the project. The directory `{project root}/.SpaceVim.d/` will also be +" added to the |'runtimepath'|. +" +" NOTE:Please be aware that if there are errors in your init.toml, +" all the setting in this toml file will not be applied. +" +" All SpaceVim options can be found in @section(options), the option name is +" same as the old vim option, but with the `g:spacevim_` prefix removed. For example: +" > +" g:spacevim_enable_statusline_tag -> enable_statusline_tag +" < +" If the fuzzy finder layer is loaded, users can use key binding `SPC h SPC` +" to fuzzy find the documentation of SpaceVim options. +" +" @subsection Add custom plugins +" +" If you want to add plugins from GitHub, just add the repo name to the custom_plugins section: +" > +" [[custom_plugins]] +" repo = 'lilydjwg/colorizer' +" # `on_cmd` option means this plugin will be loaded +" # only when the specific commands are called. +" # for example, when `:ColorHighlight` or `:ColorToggle` +" # commands are called. +" on_cmd = ['ColorHighlight', 'ColorToggle'] +" # `on_func` option means this plugin will be loaded +" # only when the specific functions are called. +" # for example, when `colorizer#ColorToggle()` function is called. +" on_func = 'colorizer#ColorToggle' +" # `merged` option is used for merging plugins directory. +" # When `merged` is `true`, all files in this custom plugin +" # will be merged into `~/.cache/vimfiles/.cache/init.vim/` +" # for neovim or `~/.cache/vimfiles/.cache/vimrc/` for vim. +" merged = false +" # For more options see `:h dein-options`. +" < +" You can also use the url of the repository, for example: +" > +" [[custom_plugins]] +" repo = "https://gitlab.com/code-stats/code-stats-vim.git" +" merged = false +" < +" To add multiple custom plugins: +" > +" [[custom_plugins]] +" repo = 'lilydjwg/colorizer' +" merged = false +" +" [[custom_plugins]] +" repo = 'joshdick/onedark.vim' +" merged = false +" < +" If you want to disable plugins which are added by SpaceVim, +" you can use the options: @section(options-disabled_plugins). " > " [options] -" enable-guicolors = true -" max-column = 120 +" # NOTE: the value should be a list, and each item is the name of the plugin. +" disabled_plugins = ["clighter", "clighter8"] " < diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 2cf67a4e1..ed548b54d 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -324,18 +324,80 @@ HIGHLIGHTED FEATURES *SpaceVim-features* ============================================================================== OPTIONS *SpaceVim-options* -SpaceVim uses `~/.SpaceVim.d/init.toml` as its default global config file. You -can set all the SpaceVim options and layers in it. `~/.SpaceVim.d/` will also -be added to runtimepath, so you can write your own scripts in it. SpaceVim -also supports local config for each project. Place local config settings in -`.SpaceVim.d/init.toml` in the root directory of your project. `.SpaceVim.d/` -will also be added to runtimepath. +The very first time SpaceVim starts up, it will ask you to choose a mode, +`basic mode` or `dark powered mode`. Then it will create a +`.SpaceVim.d/init.toml` file in your $HOME directory. All the user +configuration files are stored in ~/.SpaceVim.d/ directory. -here is an example setting SpaceVim options: +`~/.SpaceVim.d/` will also be added to |'runtimepath'|. + +It is also possible to override the location of `~/.SpaceVim.d/` by using the +environment variable `$SPACEVIMDIR`. Of course, symlinks can be used to change +the location of this directory. + +SpaceVim also supports project specific configuration files. The project +configuration file is `.SpaceVim.d/init.toml` in the root of the project. The +directory `{project root}/.SpaceVim.d/` will also be added to the +|'runtimepath'|. + +NOTE:Please be aware that if there are errors in your init.toml, all the +setting in this toml file will not be applied. + +All SpaceVim options can be found in |SpaceVim-options|, the option name is +same as the old vim option, but with the `g:spacevim_` prefix removed. For +example: +> + g:spacevim_enable_statusline_tag -> enable_statusline_tag +< +If the fuzzy finder layer is loaded, users can use key binding `SPC h SPC` to +fuzzy find the documentation of SpaceVim options. + +ADD CUSTOM PLUGINS + +If you want to add plugins from GitHub, just add the repo name to the +custom_plugins section: +> + [[custom_plugins]] + repo = 'lilydjwg/colorizer' + # `on_cmd` option means this plugin will be loaded + # only when the specific commands are called. + # for example, when `:ColorHighlight` or `:ColorToggle` + # commands are called. + on_cmd = ['ColorHighlight', 'ColorToggle'] + # `on_func` option means this plugin will be loaded + # only when the specific functions are called. + # for example, when `colorizer#ColorToggle()` function is called. + on_func = 'colorizer#ColorToggle' + # `merged` option is used for merging plugins directory. + # When `merged` is `true`, all files in this custom plugin + # will be merged into `~/.cache/vimfiles/.cache/init.vim/` + # for neovim or `~/.cache/vimfiles/.cache/vimrc/` for vim. + merged = false + # For more options see `:h dein-options`. +< +You can also use the url of the repository, for example: +> + [[custom_plugins]] + repo = "https://gitlab.com/code-stats/code-stats-vim.git" + merged = false +< +To add multiple custom plugins: +> + [[custom_plugins]] + repo = 'lilydjwg/colorizer' + merged = false + + [[custom_plugins]] + repo = 'joshdick/onedark.vim' + merged = false +< +If you want to disable plugins which are added by SpaceVim, you can use the +options: |SpaceVim-options-disabled_plugins|. > [options] - enable-guicolors = true - max-column = 120 + # NOTE: the value should be a list, and each item is the name of the + plugin. + disabled_plugins = ["clighter", "clighter8"] < ==============================================================================