https://github.com/ouuan/vim-plug-config
Manage the configs for each vim-plugged plugin in a separate file.
https://github.com/ouuan/vim-plug-config
neovim neovim-plugin vim-plug
Last synced: 11 months ago
JSON representation
Manage the configs for each vim-plugged plugin in a separate file.
- Host: GitHub
- URL: https://github.com/ouuan/vim-plug-config
- Owner: ouuan
- License: apache-2.0
- Created: 2021-05-01T14:51:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T14:22:56.000Z (over 1 year ago)
- Last Synced: 2025-05-08T23:46:12.766Z (11 months ago)
- Topics: neovim, neovim-plugin, vim-plug
- Language: Vim script
- Homepage:
- Size: 179 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-plug-config
Manage the configs for each vim-plugged plugin in a separate file.

## Requirements
- [NeoVim](https://github.com/neovim/neovim)
- [vim-plug](https://github.com/junegunn/vim-plug)
## What it does
- Automatically load configs for each plugin.
- Help you manage the config files of the plugins.
- Supports both Vim Script and Lua config files.
## Installation
```viml
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:
```viml
let g:plug_config_autoload = 0
autocmd VimEnter * PlugConfigLoadAll
```
## Commands
- `PlugConfigLoad `: Load the config of ``.
- `PlugConfigLoadAll`: Load the configs of all plugged plugins. By default, it is executed when `vim-plug-config` is loaded.
- `PlugConfigEdit `: Edit the config of ``. 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.
## Configs
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`.
### Keymaps
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.
```viml
nnoremap gp :PlugConfigEditUnderCursor
```
### `let g:plug_config_autoload`
- Default: `1`
- Whether to auto-load all configs at startup.
### `let g:plug_config_vim_dir`
- Default: `stdpath("config") . "/plug-config"` (e.g. `~/.config/nvim/plug-config`)
- Where the Vim Script config files are stored.
### `let g:plug_config_lua_dir`
- Default: `stdpath("config") . "/plug-config"` (e.g. `~/.config/nvim/plug-config`)
- Where the Lua config files are stored.
### `let g:plug_config_edit_command`
- Default: `edit`
- The command used to edit the config file. e.g. `edit`, `split`, `vsplit`.
### `let g:plug_config_default_type`
- Default: `smart`
- The language of the config files. There are four possible options:
1. `vim`: always use Vim Script.
2. `lua`: always use Lua.
3. `both`: always use both of Vim Script and Lua.
4. `smart`: use Lua if there's a `lua` directory in the plugin, otherwise use Vim Script.
### `let g:plug_config_all_header`
- 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.