Strive: Minimalist Plugin Manager for Neovim
Strive is a lightweight, feature-rich plugin manager for Neovim with support for lazy loading, dependencies, and asynchronous operations.
Features
- ✅ Asynchronous installation and updates
- ✅ Lazy loading based on events, filetypes, commands, and keymaps
- ✅ Dependency management
- ✅ Clean and intuitive API
- ✅ Minimal overhead
- ✅ Visual progress tracking
Installation
Manual Installation
git clone https://github.com/nvimdev/strive ~/.local/share/nvim/site/pack/strive/start/striveBootstrap Installation
local strive_path = vim.fn.stdpath('data') .. '/site/pack/strive/start/strive' if not vim.uv.fs_stat(strive_path) then vim.fn.system({ 'git', 'clone', '--depth=1', 'https://github.com/nvimdev/strive', strive_path }) vim.o.rtp = strive_path .. ',' .. vim.o.rtp end
Basic Usage
-- Initialize local use = require('strive').use -- Add plugins use 'neovim/nvim-lspconfig':ft({'c', 'lua'}) -- Lazy-load plugins based on events use 'lewis6991/gitsigns.nvim' :on('BufRead') -- Lazy-load by commands use 'nvim-telescope/telescope.nvim' :cmd('Telescope') -- Colorscheme use 'folke/tokyonight.nvim' :theme()
Commands
Strive provides these commands:
:Strive install- Install all plugins:Strive update- Update all plugins:Strive clean- Remove unused plugins
Lazy Loading Methods
Events
-- Load on specific events use 'lewis6991/gitsigns.nvim' :on('BufRead') -- Multiple events use 'luukvbaal/stabilize.nvim' :on({'BufRead', 'BufNewFile'})
Filetypes
-- Load for specific filetypes use 'fatih/vim-go' :ft('go') -- Multiple filetypes use 'plasticboy/vim-markdown' :ft({'markdown', 'md'})
Commands
-- Load when command is used use 'github/copilot.vim' :cmd('Copilot') -- Multiple commands use 'nvim-telescope/telescope.nvim' :cmd({'Telescope', 'Telescope find_files'})
Keymaps
-- Basic keymap in normal mode use 'folke/trouble.nvim' :keys('<leader>t') -- Specific mode, key, action and opts use 'numToStr/Comment.nvim' :keys({ {'n', '<leader>c', '<cmd>CommentToggle<CR>', {silent = true}}, {'v', '<leader>c', '<cmd>CommentToggle<CR>', {silent = true}} })
Conditional Loading
-- Load based on a condition use 'gpanders/editorconfig.nvim' :cond(function() return vim.fn.executable('editorconfig') == 1 end) -- Using a Vim expression use 'junegunn/fzf.vim' :cond('executable("fzf")')
Plugin Configuration
Setup Method
-- Call the setup function of a plugin use 'nvim-treesitter/nvim-treesitter' :setup({ ensure_installed = {'lua', 'vim', 'vimdoc'}, highlight = {enable = true}, indent = {enable = true} })
Init vs Config
-- Init runs BEFORE the plugin loads use 'mbbill/undotree' :init(function() vim.g.undotree_SetFocusWhenToggle = 1 end) -- Config runs AFTER the plugin loads use 'folke/which-key.nvim' :config(function() require('which-key').setup({ plugins = { spelling = {enabled = true} } }) end)
Build Commands
-- Run a command after installing a plugin use 'nvim-treesitter/nvim-treesitter' :run(':TSUpdate')
Local Plugin Development
-- Load a local plugin use 'username/my-plugin' :load_path('~/projects/neovim-plugins') -- Or set a global development path vim.g.strive_dev_path = '~/projects/neovim-plugins' use 'my-plugin' :load_path()
Advanced Configuration
Custom Settings
-- Set custom configuration before loading vim.g.strive_auto_install = true -- Auto-install plugins on startup vim.g.strive_max_concurrent_tasks = 8 -- Limit concurrent operations vim.g.strive_log_level = 'info' -- Set logging level (debug, info, warn, error) vim.g.strive_git_timeout = 60000 -- Git operation timeout in ms vim.g.strive_git_depth = 1 -- Git clone depth vim.g.strive_install_with_retry = false -- Retry failed installations
Example Configuration
see glepnir/nvim
Best Practices
- Group related plugins: Use dependencies to manage related plugins
- Lazy-load where possible: This improves startup time
- Use appropriate events: Choose the right events, filetypes, or commands
- Keep configuration organized: Group plugins by functionality
- Regular updates: Run
:Strive updateperiodically - Clean unused plugins: Run
:Strive cleanto remove unused plugins
Troubleshooting
If you encounter issues:
- Check the plugin is available on GitHub
- Verify your internet connection
- Increase the timeout for Git operations:
vim.g.strive_git_timeout = 300000 -- 5 minutes
- Enable debug logging:
vim.g.strive_log_level = 'debug'
- Try reinstalling:
:Strive clean :Strive install