mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
692bb22db6
* Move AUTHORS -> THANKS and remove automatic generation. THANKS is more sensible than AUTHORS. CREDITS was second best. Also, after perusing similar files in other projects I noticed some entries lacking a valid email address and decided fow now this file should be curated manually to make sure each entry contains a useful link. This allows users who have contributed to the project ways other than committing code to be added to the list as well. * Rename wait -> spin. * Remove extra padding in links. (Cosmetic) * Update to reflect API refactorings. * Fix bug causing brackets to show up in description. * Implement using spin function. * __fisher_gist_to_name uses curl to query the GitHub API which will return a JSON stream even if the Gist could not be found. So, it's not possible to determine whether we failed or not using our spin function and actually need to check the returned string to see if it contains a valid name or not. * Let git pull write errors to stderr. * Use new internal __fisher_spin. * Extract spin to independent / external module and tweak Makefile to better integrate with new install process.
345 lines
10 KiB
Groff
345 lines
10 KiB
Groff
.\" generated with Ronn/v0.7.3
|
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
|
.
|
|
.TH "FISHER\-TOUR" "7" "February 2016" "" "fisherman"
|
|
.
|
|
.SH "NAME"
|
|
\fBfisher\-tour\fR \- Fisherman Tour
|
|
.
|
|
.SH "DESCRIPTION"
|
|
Fisherman is a blazing fast, modern plugin manager for \fBfish(1)\fR\.
|
|
.
|
|
.P
|
|
Fisherman runs virtually no initialization code, making it as fast as no Fisherman\. The cache mechanism lets you query the index offline and enable or disable plugins as you wish\.
|
|
.
|
|
.P
|
|
Other features include dependency management, excellent test coverage, plugin search capabilities and full compatibility with Tackle, Oh My Fish! and Wahoo themes and plugins\.
|
|
.
|
|
.P
|
|
This document describes Fisherman features and their implementation details\. For usage and command help see \fBfisher(1)\fR\.
|
|
.
|
|
.SH "FLAT TREE"
|
|
The configuration directory structure is optimized to help your shell start new sessions as quickly as possible, regardless of the numbers of plugins or prompts enabled at any given time\.
|
|
.
|
|
.P
|
|
To explain how this is possible, we need to make a digression and discuss function scope first\. In fish, all functions share the same scope and you can use only one name per function\.
|
|
.
|
|
.P
|
|
In the following example:
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
function foo
|
|
echo $_
|
|
function bar
|
|
end
|
|
end
|
|
|
|
function bar
|
|
echo $_
|
|
end
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
\fIfoo\fR and \fIbar\fR are available immediately at the command line prompt and both print their names\. But there is a catch, calling \fIfoo\fR at least once will create a new \fIbar\fR function, effectively erasing the previous \fIbar\fR definition\. Subsequent calls to \fIbar\fR will print nothing\.
|
|
.
|
|
.P
|
|
By convention, functions that start with any number of underscores are \fIintentionally\fR private, but there is no mechanism that prevents you from calling them once they are loaded\.
|
|
.
|
|
.P
|
|
With this in mind, it\'s possible to improve the slow shell start problem using a \fIflat\fR tree structure whose path is loaded only once\.
|
|
.
|
|
.P
|
|
The overhead of juggling multiple path hierarchies in a per\-plugin basis yields no benefits as everything is shared inside the same scope\.
|
|
.
|
|
.P
|
|
Loading a path simply means adding the desired location to the \fB$fish_function_path\fR array\. See also \fBfunctions(1)\fR\.
|
|
.
|
|
.P
|
|
Here is a snapshot of an example Fisherman configuration path with a single plugin and prompt:
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
$fisher_config
|
|
|\-\- cache/
|
|
|\-\- conf\.d/
|
|
|\-\- |\-\- my_plugin\.config\.fish
|
|
|\-\- functions/
|
|
| |\-\- my_plugin\.fish
|
|
| |\-\- fish_prompt\.fish
|
|
| |\-\- fish_right_prompt\.fish
|
|
|\-\- completions/
|
|
| |\-\- my_plugin\.fish
|
|
|\-\- man/
|
|
|\-\- man1/
|
|
|\-\- my_plugin\.1
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
If you are already familiar in the way Fish handles your user configuration, you will find the above structure similar to \fB$XDG_CONFIG_HOME/fish\fR\. See \fBInitialization Files\fR in \fBhelp fish\fR to learn more about fish configuration\.
|
|
.
|
|
.P
|
|
\fBconf\.d\fR, short for configuration directory, is used for initialization files, i\.e\., files that should run at the start of the shell\. Files that follow the naming convention \fB<my_plugin>\.config\.fish\fR are added there\. If a file does not follow the \fB<my_plugin>\.config\.fish\fR convention, \fB<my_plugin>\fR will be added during the installation process\.
|
|
.
|
|
.SS "PLUGINS"
|
|
Plugins are components that extend and add features to your shell\. To see what plugins are available use \fBfisher search\fR\. You can also type \fBfisher install\fR and hit \fItab\fR once to get formatted plugin information\. The same works for \fBfisher update\fR and \fBfisher uninstall\fR\.
|
|
.
|
|
.P
|
|
To learn how to create plugins, see \fBfisher help plugins\fR\.
|
|
.
|
|
.P
|
|
You can install a plugin by their name, URL or by indicating the path to a local plugin project\.
|
|
.
|
|
.P
|
|
In order to install a plugin by \fIname\fR, it must be already published in the index database\. See \fBIndex\fR\.
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
fisher install shark
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
You can use an URL too if you have one\.
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
fisher install simnalamburt/shellder
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
If the domain or host is not provided, Fisherman will use \fBhttps://github\.com\fR by default\.
|
|
.
|
|
.P
|
|
In addition, all of the following \fBowner/repo\fR variations are accepted:
|
|
.
|
|
.IP "\(bu" 4
|
|
owner/repo \fB>\fR https://github\.com/owner/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "\(bu" 4
|
|
\fIgithub\fR/owner/repo \fB>\fR https://github\.com/owner/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "\(bu" 4
|
|
\fIgh\fR/owner/repo \fB>\fR https://github\.com/owner/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
Shortcuts to other common Git repository hosting services are also available:
|
|
.
|
|
.IP "\(bu" 4
|
|
\fIbb\fR/owner/repo \fB>\fR https://bitbucket\.org/owner/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "\(bu" 4
|
|
\fIgl\fR/owner/repo \fB>\fR https://gitlab\.com/owner/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "\(bu" 4
|
|
\fIomf\fR/owner/repo \fB>\fR https://github\.com/oh\-my\-fish/repo
|
|
.
|
|
.br
|
|
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
Because of Fisherman\'s flat tree model, there is no technical distinction between plugins or prompts\. Installing a prompt is equivalent to switching themes in other systems\. The interface is always \fIinstall\fR, \fIupdate\fR or \fIuninstall\fR\.
|
|
.
|
|
.P
|
|
Throughout this document and other Fisherman manuals you will find the term prompt when referring to the \fIconcept\fR of a theme, i\.e\., a plugin that defines a \fBfish_prompt\fR / \fBfish_right_prompt\fR function/s\.
|
|
.
|
|
.SS "INDEX"
|
|
You can install, update and uninstall plugins by their name, querying the Fisherman index\. The index is a plain text flat database independently managed\. You can use a custom index file by setting \fB$fisher_index\fR to your own file or URL\. Redirection URLs are currently not supported due to security and performance concerns\. See \fBfisher help config\fR\.
|
|
.
|
|
.P
|
|
A copy of the index is downloaded each time a search query takes place, \fB$fisher_update_interval\fR seconds since the last update\. \fB$fisher_update_interval\fR is 10 seconds by default if not set\. This helps keeping the index up to date and allows you to search the database offline\.
|
|
.
|
|
.P
|
|
The index itself is a list of records, each consisting of the following fields:
|
|
.
|
|
.IP "\(bu" 4
|
|
\fBname\fR, \fBurl\fR, \fBinfo\fR, one or more \fBtags\fR and \fBauthor\fR\.
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
Fields are separated by a new line \fB\'\en\'\fR\. Tags are separated by one \fIspace\fR\. Here is a sample record:
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
shark
|
|
https://github\.com/bucaran/shark
|
|
Fantastic Sparkline Generator
|
|
chart tool report sparkline graph
|
|
bucaran
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
To submit a new plugin for registration install the \fBsubmit\fR plugin:
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
fisher install submit
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
For usage see the bundled documentation \fBfisher help submit\fR\.
|
|
.
|
|
.P
|
|
You can also submit a new plugin manually and create a pull request in the index repository (github\.com/fisherman/fisher\-index):
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
git clone https://github\.com/fisherman/fisher\-index
|
|
cd index
|
|
echo "$name\en$URL\en$info\en$author\en$tags\en\en" >> index
|
|
git push origin master
|
|
open http://github\.com
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.SS "CACHE"
|
|
Downloaded plugins are stored as Git repositories under \fB$fisher_cache\fR\. See \fBfisher help config\fR to find out about other Fisherman configuration variables\.
|
|
.
|
|
.P
|
|
When you install or uninstall a plugin, Fisherman downloads the repository to the cache and copies only the relevant files from the cache to the loaded function and / or completion path\. In this sense, this location works also like an intermediate \fBstage\fR\. In addition, manual pages are added to the corresponding man directory and if a Makefile is also detected, the command \fBmake\fR is run\.
|
|
.
|
|
.SS "FISHFILES"
|
|
Fishfiles let you share plugin configurations across multiple installations, let plugins declare dependencies and teach Fisherman what plugins are currently enabled / disabled when using \fBfisher \-\-list\fR\.
|
|
.
|
|
.P
|
|
Your fishfile is stored in \fB$fisher_config/fishfile\fR by default, but you can customize its location setting \fB$fisher_file\fR in your user fish configuration file\.
|
|
.
|
|
.P
|
|
Here is an example fishfile inside \fB$fisher_config\fR:
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
# Ahoy! This is my Fishfile
|
|
gitio
|
|
fishtape
|
|
shark
|
|
get
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
The fishfile updates as you install / uninstall plugins\. See also \fBfisher help install\fR or \fBfisher help uninstall\fR\.
|
|
.
|
|
.SS "CONFIGURATION"
|
|
Fisherman allows a high level of configuration using \fB$fisher_*\fR variables\. You can customize the home and configuration directories, cache and fishfile location, index source URL, command aliases, etc\. See \fBfisher help config\fR\.
|
|
.
|
|
.P
|
|
You can also extend Fisherman by adding new commands and ship them as plugins\. Fisherman automatically adds completions to \fIcommands\fR based in the function \fIdescription\fR and usage help if provided\. See \fBfisher help help\fR and \fBfisher help commands\fR\.
|
|
.
|
|
.P
|
|
To add completions to standalone utility plugins, use \fBcomplete(1)\fR\.
|
|
.
|
|
.SS "CLI"
|
|
If you are already familiar with other UNIX tools, you\'ll find Fisherman commands behave intuitively\.
|
|
.
|
|
.P
|
|
Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other\.
|
|
.
|
|
.P
|
|
Fisherman also ships with a CLI options parser and a background job spinner that you can use to implement your own commands CLI\. See \fBgetopts(1)\fR and \fBspin(1)\fR\.
|
|
.
|
|
.SH "COMPATIBILITY"
|
|
Fisherman supports Oh My Fish! themes and plugins, but some features are turned off by default for performance reasons\.
|
|
.
|
|
.P
|
|
Oh My Fish! evaluates every \fI\.fish\fR file inside the root directory for every plugin installed during shell start\. This is necessary in order to load any existing \fBinit\fR event functions and immediately invoke them using fish \fBemit(1)\fR\.
|
|
.
|
|
.P
|
|
Since it is not possible to determine whether a file defines an initialization event without evaluating its contents first, Oh My Fish! sources all \fB*\.fish\fR files and then emits events for each plugin\.
|
|
.
|
|
.P
|
|
Not all plugins opt in the initialization mechanism, therefore support for this behavior is turned off by default\. If you would like Fisherman to behave like Oh My Fish! at the start of the shell session, install the \fBlegacy\fR compatibility plugin\.
|
|
.
|
|
.IP "" 4
|
|
.
|
|
.nf
|
|
|
|
fisher install legacy
|
|
.
|
|
.fi
|
|
.
|
|
.IP "" 0
|
|
.
|
|
.P
|
|
This plugin also adds definitions for some of Oh My Fish! Core Library functions\.
|
|
.
|
|
.SH "SEE ALSO"
|
|
fisher(1)
|
|
.
|
|
.br
|
|
fisher help
|
|
.
|
|
.br
|
|
fisher help config
|
|
.
|
|
.br
|
|
fisher help plugins
|
|
.
|
|
.br
|
|
fisher help commands
|
|
.
|
|
.br
|
|
spin(1)
|
|
.
|
|
.br
|
|
getopts(1)
|
|
.
|
|
.br
|