Manage the configs for each vim-plugged plugin in a separate file.
- Automatically load configs for each plugin.
- Help you manage the config files of the plugins.
- Supports both Vim Script and Lua config files.
Plug 'ouuan/vim-plug-config'
You'd better add this as the first plugin in your plug list to prevent setting configs for other plugins after they are loaded.
Alternatively, you can load the configs on the VimEnter event:
let g:plug_config_autoload = 0
autocmd VimEnter * PlugConfigLoadAll
PlugConfigLoad <plug-name>
: Load the config of<plug-name>
.PlugConfigLoadAll
: Load the configs of all plugged plugins. By default, it is executed whenvim-plug-config
is loaded.PlugConfigEdit <plug-name>
: Edit the config of<plug-name>
. e.g.:PlugConfigEdit 'vim-plug-config'
PlugConfigEditUnderCuror
: Edit the plug under the cursor (if there's aPlug 'owner/repo'
command in the current line). It does nothing if there's no plugged plugin under the cursor.PlugConfigAll
: Show all plugin configs in a single file. It is useful for looking for a certain setting or restore to a single-file config.PlugConfigClean
: Delete empty config files and the config files for unplugged plugins.
Note: These variables shouldn't be set in the plug-config
file of vim-plug-config
itself. i.e. you need to set them in your init.vim
.
It's recommended to map a key to PlugConfigEditUnderCursor
so that you can use it to jump to the config file on the Plug 'owner/repo'
line.
nnoremap gp :PlugConfigEditUnderCursor<CR>
- Default:
1
- Whether to auto-load all configs at startup.
- Default:
stdpath("config") . "/plug-config"
(e.g.~/.config/nvim/plug-config
) - Where the Vim Script config files are stored.
- Default:
stdpath("config") . "/plug-config"
(e.g.~/.config/nvim/plug-config
) - Where the Lua config files are stored.
- Default:
edit
- The command used to edit the config file. e.g.
edit
,split
,vsplit
.
- Default:
smart
- The language of the config files. There are four possible options:
vim
: always use Vim Script.lua
: always use Lua.both
: always use both of Vim Script and Lua.smart
: use Lua if there's alua
directory in the plugin, otherwise use Vim Script.
- Default:
'Configs for plug: {plug}'
- The header comment of the config of each plugin shown in
PlugConfigAll
.{plug}
will be replaced by the name of the plugin.