Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A minimalist package manager for fish shell

License

NotificationsYou must be signed in to change notification settings

danhper/fundle

Repository files navigation

A minimalist package manager forfish inspired byVundle.

All plugins are installed/updated using git, so the only requirement is to havegit installed and on the path (and well, fish, obviously).

This package manager is compatible withoh-my-fish plugins.If you need the core functions ofoh-my-fish,you can use thedanhper/oh-my-fish-core plugin.

Installation

You can use the installer:

curl -sfL https://git.io/fundle-install| fish

Or if you don't like to pipe to a shell, just dropfundle.fishin your~/.config/fish/functions directory and you are done.

mkdir -p~/.config/fish/functionswget https://git.io/fundle -O~/.config/fish/functions/fundle.fish

Automatic install

If you want to automatically install fundle when it is not present, you can addthe following at the top of your~/.config/fish/config.fish.

ifnotfunctions-q fundle;eval (curl-sfL https://git.io/fundle-install);end

ArchLinux

fundle is available on the AUR, so you can install it system wide with

yaourt -S fundle-git

Updating

From fundle 0.2.0 and onwards, you can usefundle self-update to update fundle.

Usage

Sampleconfig.fish

Add this to your~/.config/fish/config.fish or any file that you use to load fundle's plugins (in/etc/fish for example):

fundle plugin 'edc/bass'fundle plugin 'oh-my-fish/plugin-php'fundle plugin 'danhper/fish-fastdir'fundle plugin 'danhper/fish-theme-afowler'fundle init

This will source the four plugins listed and load all the functions and completions found.

Note that thefundle init is required on each file loading a plugin, so if you load plugins in multiple .fish files, you have to addfundle init to each one of them.

After editingconfig.fish:

  1. Reload your shell (you can runexec fish for example)
  2. Runfundle install
  3. That's it! The plugins have been installed in~/.config/fish/fundle

In depth

To add a plugin, you simply need to open~/.config/fish/config.fish and add:

fundle plugin 'repo_owner/repo_name'

For example:

fundle plugin 'danhper/fish-fastdir'

will install the repository athttps://github.com/danhper/fish-fastdir.

To pick a specific version of the plugins, you can append @ followed by a tag from the repo:

fundle plugin 'joseluisq/gitnow@2.7.0'

will install Gitnow release 2.7.0 athttps://github.com/joseluisq/gitnow/releases/tag/2.7.0.

If you need to change the repository, you can pass it with--url andit will be passed directly togit clone:

fundle plugin 'danhper/fish-fastdir' --url 'git@github.com:danhper/fish-fastdir.git'

Keep in mind that this option overrides any tag set with '@'.

It also works with other repository hosts:

fundle plugin 'username/reponame' --url 'git@gitlab.com:username/reponame.git'

And it works with https remote as well (in case you have "the authenticity of host github can't be established"):

fundle plugin 'username/reponame' --url 'https://gitlab.com/username/reponame.git'

You can also use a branch, tag or anycommit-ish by appending#commit-ish to the URL. For example:

fundle plugin 'danhper/fish-fastdir' --url 'git@github.com:danhper/fish-fastdir.git#my-branch'

will usemy-branch. If no commit-ish is passed, it will default tomaster.

If the fish functions or completions are in a subdirectory of the repository, you can use--path to choose the path to load.

fundle plugin 'tmuxnator/tmuxinator' --path 'completion'

After having made all the calls tofundle plugin, you need to add

fundle init

in your configuration file for the plugins to be loaded.

IMPORTANT: When you add new plugins, you must restart your shellbefore runningfundle install.The simplest way to do this is probably to runexec fish in the running shell.

You can then run

fundle install

for fundle to download them.

You can also use

fundle update

to update the plugins.

Commands

  • fundle init: Initialize fundle, loading all the available plugins
  • fundle install: Install all plugins
  • fundle update: Update all plugins (deprecates:fundle install -u)
  • fundle plugin PLUGIN [--url PLUGIN_URL] [--path PATH]: Add a plugin to fundle.
    • --url set the URL to clone the plugin.
    • --path set the plugin path (relative to the repository root)
  • fundle list [-s]: List the currently installed plugins, including dependencies (-s gives a shorter version)
  • fundle clean: Cleans unused plugins
  • fundle self-update: Updates fundle to the latest version
  • fundle version: Displays the current version of fundle
  • fundle help: Displays available commands

Completions are available in thecompletions/fundle.fish.Note that you will need to installfish-completion-helpersto use them.

Plugin structure

A plugin basically has the following structure.

.├── completions│   └── my_command.fish├── functions│   ├── __plugin_namespace_my_function.fish│   └── my_public_function.fish├── init.fish└── README.md
  • init.fish will be sourced directly, so it should not do anything that takes too longto avoid slowing down the shell startup. It is a good place to put aliases, for example.
  • functions is the directory containing the plugin functions. This directory willbe added tofish_function_path, and will therefore be auto loaded. I suggest youprefix your functions with__plugin_name if the user will not be using them explicitly.
  • completions is the directory containing the plugin completions. This directory willbe added tofish_complete_path.

NOTE: if noinit.fish file is found, the root folder of the plugin is treatedas a functions directory. This is to make the plugins compatible withoh-my-fish plugins themes.

Managing dependencies

fundle can manage dependencies for you very easily.You just have to add

fundle plugin 'my/dependency'

in your plugininit.fish and fundle will automatically fetch and install themissing dependencies when installing the plugin.

I created a minimal example infish-nvm,which depends onedc/bass.

Profiling

Obviously, adding plugins makes the shell startup slower. It should usually be short enough,but if you feel your shell is becoming to slow, fundle has a very basic profilingmode to help you.

All you need to do is to change

fundle init

to

fundle init --profile

in yourconfig.fish and fundle will print the time it took to load each plugin.

NOTE:

  • You will need thegdate command on OSX. You can install it withbrew install coreutils.
  • This functionality simply uses thedate command, so it prints the real time,not the CPU time, but it should usually be enough to detect if something is wrong.
  • When a plugin include dependencies, the load time for each dependency is added to theparent plugin load time.

Compatible plugins

Mostoh-my-fish plugins should work out of the boxor withdanhper/oh-my-fish-core installed.

Please feel free to edit thewiki and addyour plugins, or plugins you know work with fundle.

Contributing

Contributions are very appreciated. Please open an issue or create a PR if youwant to contribute.

If you created a package compatible with fundle, feel free toadd it to the Wiki.

Motivations

I know thatoh-my-fish has a utility toinstall packages, but I wanted the simplest tool possible, not a whole framework.

Changelog

  • 2016-04-06 (v0.5.1): Fixfundle help to showclean command.
  • 2016-04-06 (v0.5.0): Addfundle clean. Deprecatefundle install -u and addfundle update thanks to @enricobacis.
  • 2015-12-22 (v0.4.0): Add--path option, thanks to @Perlence.
  • 2015-12-16 (v0.3.2): Fix profiling in OSX.
  • 2015-12-14 (v0.3.1): Fix incompatibility with oh-my-fish. Renameplugins tolist.
  • 2015-12-14 (v0.3.0): Fix dependency load order. Add profiling mode.
  • 2015-12-14 (v0.2.2): Emit plugin initialization event
  • 2015-12-07 (v0.2.1): Usecurl instead ofwget forself-update
  • 2015-12-07 (v0.2.0): Addself-update command
  • 2015-12-07 (v0.1.0): Fix bug with dependency loading infundle init
  • 2015-11-24: Allow the use of#commit-ish when using plugin repo. Checkout repositorycommit-ish instead of using master branch.

About

A minimalist package manager for fish shell

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors13


[8]ページ先頭

©2009-2025 Movatter.jp