Minimalistic Git-based fish plugin manager.
Note
plug.fish v3 is a complete rewrite. Previous versions are available on other branches.
- Doesn't occupy
~/.config/fish - Flexible plugin management
- Support Fisher plugins
- < 100 lines of code you can actually read and understand
- fish >= 3.5
- Git
-
Add the following to your
~/.config/fish/config.fishset plugins https://github.com/kidonng/plug.fish source (path filter $__fish_user_data_dir/plugins/plug.fish/conf.d/plugin_load.fish || curl https://raw.githubusercontent.com/kidonng/plug.fish/v3/conf.d/plugin_load.fish | psub)
-
Restart fish
exec fish
Adding plugins is as easy as setting $plugins:
# Missing plugins are downloaded the next shell session
set plugins \
https://github.com/kidonng/plug.fish \
https://github.com/other/plugin \
~/any/git/repositoryUpdate plugins by running plugin_update:
$ plugin_update
Updating example-plugin
Updating another-pluginDon't want some plugin to update? Add it to $plugins_pinned:
set plugins \
https://github.com/kidonng/plug.fish \
https://github.com/plugin/to-be-pinned
# Use the last segment as identifier
set plugins_pinned to-be-pinnedNot into some plugin? Remove it from $plugins to disable it or even run plugin_uninstall:
$ plugin_uninstall
example-plugin is disabled, uninstall? (y/N)Don't like editing config files? Make $plugins a universal variable and set becomes a plugin manager:
$ set --universal plugins \
https://github.com/kidonng/plug.fish \
https://github.com/plugin/foo
$ # Add plugin bar
$ set --append plugins https://github.com/plugin/bar && exec fish
$ # Remove plugin foo
$ set --erase plugins[2] && plugin_uninstallEdit ~/.config/fish/config.fish:
- set plugins \
+ set --query plugins || set plugins \
https://github.com/kidonng/plug.fish \
https://github.com/plugin/foo \
https://github.com/plugin/barNow you are able to load plugins however you want:
# Only the first two plugins will be loaded in the new shell!
plugins=$plugins[..2] exec fishCreating ~/.config/fish/conf.d/foo.fish prevents loading some-plugin/conf.d/foo.fish (masking).
This is per the behavior described in fish documentation:
If there are multiple files with the same name in these directories, only the first will be executed.