{"id":27142385,"url":"https://github.com/log0u7/vim-plugin-manager","last_synced_at":"2025-04-08T07:46:23.335Z","repository":{"id":285382367,"uuid":"957868167","full_name":"log0u7/vim-plugin-manager","owner":"log0u7","description":"A lightweight Vim plugin manager that uses Git submodules and Vim 8's native package system.","archived":false,"fork":false,"pushed_at":"2025-04-07T13:01:02.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T13:26:45.123Z","etag":null,"topics":["git","gitsubmodules","vim","vim-plugin","vim-plugin-manager"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/log0u7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T09:13:59.000Z","updated_at":"2025-04-07T12:57:08.000Z","dependencies_parsed_at":"2025-03-31T12:52:49.277Z","dependency_job_id":null,"html_url":"https://github.com/log0u7/vim-plugin-manager","commit_stats":null,"previous_names":["log0u7/vim-plugin-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log0u7%2Fvim-plugin-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log0u7%2Fvim-plugin-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log0u7%2Fvim-plugin-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log0u7%2Fvim-plugin-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/log0u7","download_url":"https://codeload.github.com/log0u7/vim-plugin-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801182,"owners_count":20998331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","gitsubmodules","vim","vim-plugin","vim-plugin-manager"],"created_at":"2025-04-08T07:46:22.915Z","updated_at":"2025-04-08T07:46:23.328Z","avatar_url":"https://github.com/log0u7.png","language":"Vim Script","readme":"# Vim Plugin Manager\n\nA lightweight Vim/Neovim plugin manager that uses Git submodules and Vim 8's native package system.\n\n## Features\n\n- Manage plugins through Git submodules\n- Easy installation, removal, and updating of plugins\n- Automatic generation of helptags\n- Backup your entire Vim configuration to multiple remote repositories\n- Works with Vim 8's native package loading system\n- Full Git integration for plugin versioning\n- Support for optional (lazy-loaded) plugins\n- Interactive sidebar interface\n- Compatible with both Vim and Neovim\n\n## Requirements\n\n- Vim 8.0+ or Neovim\n- Git 2.40 or higher\n\n## Installation\n\n### Prerequisites\n\n- Vim 8.0+ or Neovim\n- Git 2.40 or higher\n\n### Simple Installation\n\n1. **Initialize your Vim configuration as a Git repository** (if not already done):\n\n```bash\n# If you don't already have a Git repository for your Vim configuration\ncd ~/.vim     # For Vim (or ~/.config/nvim for Neovim)\ngit init\n```\n\n2. **Add the plugin manager as a submodule**:\n\n```bash\n# Add the plugin as a submodule directly to the appropriate location\ngit submodule add https://github.com/yourusername/vim-plugin-manager.git ~/.vim/pack/plugins/start/vim-plugin-manager\n```\n\n3. **Generate helptags** (choose one method):\n\n```bash\n# From the command line\nvim -c \"helptags ~/.vim/pack/plugins/start/vim-plugin-manager/doc\" -c q\n```\n\nOr after opening Vim:\n\n```vim\n:helptags ~/.vim/pack/plugins/start/vim-plugin-manager/doc\n```\n\nThat's it! The plugin manager will automatically create necessary directories when you install plugins.\n\n## Managing Your Configuration\n\n### Custom Plugin Configurations\n\nSince the plugin manager uses Git to manage your `.vim` directory, it can create and version control various subdirectories (like `.vim/plugin`, `.vim/ftdetect`, `.vim/ftplugin`, etc.) for its own configurations and mappings.\n\nA good practice is to create your own configuration files for each plugin you install. For example:\n\n```\n~/.vim/plugin/nerdtree_config.vim\n~/.vim/plugin/fzf_config.vim\n~/.vim/plugin/fugitive_config.vim\n```\n\nThese files will be automatically included in backups when using `:PluginManager backup` since the plugin manager will commit all changes in your Vim configuration directory before pushing to remote repositories. This ensures that all your custom configurations, mappings, and settings are properly versioned and backed up.\n\n### Example Plugin Configurations\n\nHere are some examples for common plugins:\n\n**NERDTree Configuration** (`~/.vim/plugin/nerdtree_config.vim`):\n```vim\n\" Custom NERDTree configuration\nlet g:NERDTreeShowHidden = 1\nlet g:NERDTreeMinimalUI = 1\nlet g:NERDTreeIgnore = ['^\\.git$', '^\\.DS_Store$']\nnnoremap \u003cleader\u003en :NERDTreeToggle\u003cCR\u003e\n```\n\n**FZF Configuration** (`~/.vim/plugin/fzf_config.vim`):\n```vim\n\" Custom FZF configuration\nlet g:fzf_layout = { 'down': '~40%' }\nnnoremap \u003cleader\u003ef :Files\u003cCR\u003e\nnnoremap \u003cleader\u003eb :Buffers\u003cCR\u003e\nnnoremap \u003cleader\u003eg :GFiles\u003cCR\u003e\n```\n\n**Fugitive Configuration** (`~/.vim/plugin/fugitive_config.vim`):\n```vim\n\" Custom Fugitive configuration\nnnoremap \u003cleader\u003egs :Git\u003cCR\u003e\nnnoremap \u003cleader\u003egc :Git commit\u003cCR\u003e\nnnoremap \u003cleader\u003egp :Git push\u003cCR\u003e\n```\n\n### Using .gitignore\n\nTo exclude certain files from version control, create a `.gitignore` file in your Vim configuration directory:\n\n```bash\n# Create a .gitignore file\ntouch ~/.vim/.gitignore\n```\n\nAdd the following content to exclude temporary files, undo history, swap files, and helptags:\n\n```\n# Ignore undo history\nundodir/*\n# Ignore swap files\n*.swp\n*.swo\n.*.swp\n.*.swo\nswapdir/*\n# Ignore helptags\ndoc/tags\n**/doc/tags\n# Ignore netrw history\n.netrwhist\n# Ignore session files\nsession/*\n# Ignore local vimrc files\n.exrc\n.vimrc.local\n```\n\nMake sure to commit your `.gitignore` file:\n\n```bash\ngit add .gitignore\ngit commit -m \"Add .gitignore for Vim configuration\"\n```\n\n### Alternative: Creating Your Own Plugin Structure\n\nIf you prefer, you can create your own plugin structure as a Git submodule:\n\n```bash\n# Create your custom Vim configuration repository\nmkdir ~/my-vim-config\ncd ~/my-vim-config\ngit init\n\n# Create the standard Vim directory structure\nmkdir -p plugin ftplugin ftdetect syntax autoload doc colors after\n\n# Add your configurations to the appropriate directories\n# For example:\ntouch plugin/mappings.vim\ntouch plugin/settings.vim\ntouch plugin/plugin_configs.vim\n\n# Commit your changes\ngit add .\ngit commit -m \"Initial setup of my Vim configuration\"\n\n# Push to your own repository (optional)\ngit remote add origin https://github.com/yourusername/my-vim-config.git\ngit push -u origin main\n\n# Now add this as a submodule to your Vim configuration\n# You can use either direct Git command:\ncd ~/.vim\ngit submodule add https://github.com/yourusername/my-vim-config.git pack/personal/start/my-vim-config\n\n# Or use PluginManager itself:\n:PluginManager add https://github.com/yourusername/my-vim-config.git {'dir':'my-vim-config'}\n```\n\nThis approach keeps your personal configurations organized and separate from the plugin manager and other plugins.\n\n## Usage\n\n### Installing Plugins\n\n```vim\n\" Install a plugin from GitHub (username/repo format)\n:PluginManager add tpope/vim-fugitive\n\n\" Install a plugin to start/ directory (auto-loaded) using full URL\n:PluginManager add https://github.com/tpope/vim-fugitive.git\n\n\" Install with options (new format)\n:PluginManager add tpope/vim-surround {'dir':'surround', 'load':'start', 'branch':'main'}\n\n\" Install as an optional plugin with a specific tag\n:PluginManager add tpope/vim-commentary {'load':'opt', 'tag':'v1.3'}\n\n\" Install a plugin and run a command after installation\n:PluginManager add junegunn/fzf {'exec':'./install --all'}\n\n\" For backward compatibility:\n\" Install with a custom name (old format)\n:PluginManager add tpope/vim-surround surround\n\n\" Install as an optional plugin (old format)\n:PluginManager add tpope/vim-commentary commentary opt\n\n\" Install a plugin from a custom URL (non-GitHub)\n:PluginManager add https://gitlab.com/user/repo.git\n```\n\n### Declarative Plugin Configuration in vimrc\n\nYou can define all your plugins in your vimrc file using the declarative syntax. This is especially helpful for managing multiple plugins and ensuring your setup is reproducible:\n\n```vim\n\" In your vimrc file:\nPluginBegin\n  \" Basic syntax: Plugin 'username/repo'\n  Plugin 'tpope/vim-fugitive'\n  Plugin 'tpope/vim-surround'\n\n  \" With options:\n  Plugin 'preservim/nerdtree', {'load': 'opt'}\n  Plugin 'junegunn/fzf', {'dir': 'fzf', 'exec': './install --all'}\n  Plugin 'fatih/vim-go', {'tag': 'v1.28'}\n  Plugin 'neoclide/coc.nvim', {'branch': 'release'}\n\n  \" Local plugin (from filesystem):\n  Plugin '~/projects/my-vim-plugin'\nPluginEnd\n```\n\nWhen Vim loads your vimrc, all these plugins will be installed automatically if they don't exist yet. This allows you to easily manage your plugin collection and share your configuration with others.\n\n### Removing Plugins\n\n```vim\n\" With confirmation\n:PluginManager remove fugitive\n\n\" Force remove without confirmation\n:PluginManager remove surround -f\n```\n\n### Managing Plugins\n\n```vim\n\" List all installed plugins\n:PluginManager list\n\n\" Show status of all plugins\n:PluginManager status\n\n\" Update all plugins\n:PluginManager update\n\n\" Update a specific plugin\n:PluginManager update vim-fugitive\n\n\" Show a summary of all plugin changes\n:PluginManager summary\n\n\" Generate helptags for all plugins\n:PluginManager helptags\n\n\" Generate helptags for a specific plugin\n:PluginManager helptags vim-fugitive\n\n\" Reload a specific plugin\n:PluginManager reload vim-fugitive\n\n\" Reload all Vim configuration\n:PluginManager reload\n```\n\n### Backup and Restore\n\n```vim\n\" Commit any changes to vimrc, custom configurations, and new plugins, then push to all remotes\n:PluginManager backup\n\n\" Reinstall all plugins from .gitmodules\n:PluginManager restore\n\n\" Add a new backup repository\n:PluginManagerRemote https://github.com/yourusername/vim-config-backup.git\n```\n\nThe backup command will:\n1. Copy your main configuration file (`.vimrc` or `init.vim`) into your `.vim` directory to ensure it's versioned along with everything else\n2. Commit all changes in your Vim configuration directory, including:\n   - Your custom plugin configurations in the `plugin/` directory\n   - Any modifications to settings in `ftplugin/`, `syntax/`, `colors/`, etc.\n   - New or modified mappings and commands\n   - Any file not excluded by `.gitignore`\n\nNote that while your own configuration files are backed up, changes inside plugin submodules themselves won't be included in the backup - these are tracked separately as Git submodules pointing to specific commits.\n\n**Important Security Note**: Never store sensitive information (API keys, GPG keys, tokens, passwords) in your versioned configuration files. Instead:\n\n1. Create separate configuration files for secrets:\n   ```\n   ~/.vim/plugin/fugitive-secrets.vim\n   ~/.vim/plugin/api-secrets.vim\n   ~/.vim/plugin/private-settings.vim\n   ```\n\n2. Exclude these files in your `.gitignore`:\n   ```\n   # Ignore secret configuration files\n   plugin/*-secrets.vim\n   plugin/private-*.vim\n   ```\n\n3. Or use a private repository if your entire configuration contains sensitive information\n\n\n4. You also can reference external files from your main configuration:\n```vim\n\" In your .vimrc\nif filereadable(expand(\"~/api-secrets.vim\"))\n  source ~/api-secrets.vim\nendif\n```\n\n### Interactive Interface\n\n```vim\n\" Toggle the plugin manager sidebar\n:PluginManagerToggle\n```\n\n#### Sidebar Keyboard Shortcuts\n\n- `q` - Close the sidebar\n- `l` - List installed plugins\n- `u` - Update all plugins\n- `h` - Generate helptags for all plugins\n- `s` - Show status of submodules\n- `b` - Backup configuration\n- `r` - Restore all plugins\n- `R` - Reload configuration\n- `?` - Show usage information\n\n### Backup Configuration to Multiple Repositories\n\n```bash\ncd ~/.vim\ngit remote rename origin genesis\ngit remote add origin your_repository_url\n\n# Optional: Add backup repositories\ngit remote set-url origin --add --push second_repository_url\ngit remote set-url origin --add --push third_repository_url\n```\n\n## Configuration\n\nYou can customize the plugin manager by setting the following variables in your vimrc:\n\n```vim\n\" Custom Vim/Neovim configuration directory\nlet g:plugin_manager_vim_dir = '~/.vim'  \" or '~/.config/nvim' for Neovim\n\n\" Custom plugin directory\nlet g:plugin_manager_plugins_dir = '~/.vim/pack/plugins'\n\n\" Custom directory for auto-loaded plugins\nlet g:plugin_manager_start_dir = 'start'\n\n\" Custom directory for optional (lazy-loaded) plugins\nlet g:plugin_manager_opt_dir = 'opt'\n\n\" Custom vimrc location\nlet g:plugin_manager_vimrc_path = '~/.vim/vimrc'  \" or '~/.config/nvim/init.vim'\n\n\" Custom sidebar width\nlet g:plugin_manager_sidebar_width = 60\n\n\" Default git host for short plugin names\nlet g:plugin_manager_default_git_host = 'github.com'\n```\n\n## Tips \u0026 Tricks\n\n### Loading Optional Plugins\n\nOptional plugins installed with the 'opt' parameter can be loaded with:\n\n```vim\n:packadd plugin-name\n```\n\nYou can also load them conditionally in your vimrc:\n\n```vim\nif has('feature')\n  packadd plugin-name\nendif\n```\n\n### Using Plugin Options\n\nThe options system allows for flexible plugin installation almost like [junegunn/vim-plug](https://github.com/junegunn/vim-plug/):\n\n```vim\n\" Install a plugin and specify a branch\n:PluginManager add tpope/vim-fugitive {'branch': 'main'}\n\n\" Install a plugin to a specific directory and specific tag\n:PluginManager add junegunn/fzf {'dir': 'myfzf', 'tag': 'v0.24.0'}\n\n\" Install a plugin and execute a command after installation\n:PluginManager add junegunn/fzf {'exec': './install --all'}\n```\n\n### Managing Plugin Updates\n\nWhen updating plugins, PluginManager will stash any local changes in the plugin repositories. If you've made custom modifications to plugins, consider using a different approach like git patches.\n\n## Troubleshooting\n\n### Issues with Plugin Installation\n\n- Make sure your Vim configuration directory is a Git repository\n- Check that you have write permissions to the plugin directories\n- Verify the plugin URL is correct and accessible\n\n### Plugin Not Loading\n\n- For 'start' plugins, ensure they're in the correct directory\n- For 'opt' plugins, make sure you're using `:packadd` to load them\n- Reload your vimrc after installing new plugins\n\n### Git-related Errors\n\n- Most issues are related to Git submodule commands\n- Run `:PluginManager status` to check the status of all modules\n- Try running `:PluginManager restore` to reinitialize all modules\n\n## Full Documentation\n\nFor detailed documentation, use the `:help plugin-manager` command after installation.\n\n## License\n\nPluginManager is released under the MIT License.\n\nCopyright (c) 2018 - 2025 G.K.E. \u003cgke@6admin.io\u003e\n\n## About\n\n- Maintained by: G.K.E. \u003cgke@6admin.io\u003e\n- Source: https://github.com/username/vim-plugin-manager\n- Version: 1.3","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog0u7%2Fvim-plugin-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flog0u7%2Fvim-plugin-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog0u7%2Fvim-plugin-manager/lists"}