Manage the configs for each vim-plugged plugin in a separate file.
APACHE-2.0 License
Manage the configs for each vim-plugged plugin in a separate file.
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 when vim-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 a Plug '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>
let g:plug_config_autoload
1
let g:plug_config_vim_dir
stdpath("config") . "/plug-config"
(e.g. ~/.config/nvim/plug-config
)let g:plug_config_lua_dir
stdpath("config") . "/plug-config"
(e.g. ~/.config/nvim/plug-config
)let g:plug_config_edit_command
edit
edit
, split
, vsplit
.let g:plug_config_default_type
smart
vim
: always use Vim Script.lua
: always use Lua.both
: always use both of Vim Script and Lua.smart
: use Lua if there's a lua
directory in the plugin, otherwise use Vim Script.let g:plug_config_all_header
'Configs for plug: {plug}'
PlugConfigAll
. {plug}
will be replaced by the name of the plugin.