mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
Ahoy my mateys! fisherman 2.0.0 (beta) is here.
A lot has changed, in fact, fisherman as you knew it, is no longer with us. Let me explain. The new fisherman, is in fact a rewired clone of ``fin´´, a short-lived 2 week experiment that started because it was easier to rewrite everything than moving fisherman forward. Let me explain. I was longing for a lightweight, simpler fisherman with minimal maintanance cost. This fin lad is one of the most pragmatic pieces of code I've ever written, but attempting to maintain two drastically different plugin managers was not a sane decision. fin's goal was to get out of my way and let me be productive with fish and it did. Now fin is fisherman and fisherman is fin. The most notable change is that fisherman no longer depends on an index, so like fin, it's neutral and agnostic to what plugins you use. No index means fisherman completions are no longer as clever as to show you description of plugins, but you will still get enough information to know whether the plugin is a theme or not. I hope you always check the plugin's README / online docs before installing anything anyway. With the index gone, we had no use for ``search``, so this command is also gone. If you were using search often or depended on the removed features above, I am afraid they are gone *gone*, but trust me it's all for the very best. Now, with this out of the way, it's all unicorns and dartfish. Almost. To upgrade to fisherman 2.0.0 you need to REMOVE your current version of fisherman: 1. ```rm -rf "$fisher_home" "$fisher_config"``` 2. Open your config.fish and remove the fisherman initialization code. 3. ```exec fish < /dev/tty``` to reload the session. 4. Run `curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman` That's it. Probably. The new fisherman brings a lot more stability and maturity to the project and we need this change in order to move forward. I will be actively fixing any bugs that may have sneaked in during the ```fin->fisherman``` rewiring, but please do ping me: @bucaran on GitHub or directly to my email j@bucaran.me if you find anything out of place. Feel free and invited to go wild with issues in order to get this into shape ASAP. Cheers!
This commit is contained in:
parent
d7eb47feb4
commit
85f897104d
206 changed files with 2393 additions and 7462 deletions
|
@ -1,7 +0,0 @@
|
|||
root = true
|
||||
[*]
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
.DS_Store
|
|
@ -4,5 +4,5 @@ before_install:
|
|||
- sudo apt-get update
|
||||
- sudo apt-get -y install fish
|
||||
script:
|
||||
- bin/install
|
||||
- fish -c "fisher i fishery/fishtape; fishtape test/*.fish"
|
||||
- curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman
|
||||
- fish -c "fisher fishtape .; fishtape test/*.fish"
|
||||
|
|
409
CHANGELOG.md
409
CHANGELOG.md
|
@ -1,409 +0,0 @@
|
|||
# Change Log
|
||||
|
||||
## [1.5.0][v150] - 2016-04-18
|
||||
|
||||
* So long `make`, the fisherman installer is now entirely written in fish #196, #184.
|
||||
|
||||
## [1.4.0][v140] - 2016-03-31
|
||||
|
||||
* :warning: Deprecate --force flag in fisher install.
|
||||
|
||||
* Now fisher list does not show plugins that are disabled, but available in the cache. To see these items use fisher list --disabled.
|
||||
|
||||
* Welcome aboard @orangecms and @xrain0610.
|
||||
|
||||
* Fisherman is now [available](https://aur.archlinux.org/packages/fisherman-git/) in the Arch User Repository.
|
||||
|
||||
* Fix load order during installation. Now snippets can safely invoke functions defined in the plugin function directory. Thanks @orangecms. #170.
|
||||
|
||||
* Fisherman installs and updates plugins in **⌁ parallel** now. Performance will vary, but chances are you will perceive 3 to 10 times faster updates.
|
||||
|
||||
![para](https://cloud.githubusercontent.com/assets/8317250/13730493/5b704bec-e994-11e5-81b9-d3af2c0f9821.gif)
|
||||
|
||||
* Deprecate fisher list file in favor of
|
||||
|
||||
```
|
||||
fisher list - < file
|
||||
```
|
||||
|
||||
## [1.3.1][v131] - 2016-03-12
|
||||
|
||||
* Fix bug in fisher_config_color_reset not declaring path variable.
|
||||
* Silence Git checkout standard error to prevent update failures in some edge cases.
|
||||
* Revise and correct errors in the documentation and README.
|
||||
* Add more instrumentation to fisher_plugin_disable.
|
||||
* Minor doc updates.
|
||||
|
||||
## [1.3.0][v130] - 2016-03-09
|
||||
|
||||
* Merge tutorial and CLI documentation into one document.
|
||||
* Update README with new simplified documentation.
|
||||
* Tweak fisher help menu to highlight command aliases.
|
||||
|
||||
## [1.2.0][v120] - 2016-03-08
|
||||
|
||||
* Introduce set_color_custom function that prompts can define to customize *fish_color_* variables. The current color palette is saved to $fisher_config/fish_colors and restored when the prompt is disabled / uninstalled #144.
|
||||
|
||||
* Fix a bug where fisher_path_is_prompt was not picking up prompts that define functions inside a functions directory. #155.
|
||||
|
||||
* Add support to read oh-my-fish bundle file package declarations.
|
||||
|
||||
## [1.1.0][v110] - 2016-03-02
|
||||
|
||||
* Fix regression causing update to fail in some plugins. aa8a98a
|
||||
* Be more secretive about index updates. c0c7f6a
|
||||
* Move debug from fisher_plugin_source to before call. 8fd8dc0
|
||||
* Add ascii cast. c4c9577
|
||||
|
||||
## [1.0.0][v100] - 2016-03-01
|
||||
|
||||
* Deprecate fisher --list in favor of a new command fisher list. The behavior is roughly the same. See fisher help list for usage. tl;dr: Use list to query the local system / cache and search to query the index.
|
||||
|
||||
![](https://cloud.githubusercontent.com/assets/8317250/13388099/8973fbe0-df00-11e5-95c8-4bbb0e7172ae.gif)
|
||||
|
||||
* Teach fisher_plugin_walk about fish_postexec, fish_command_not_found and fish_preexec event emitters and erase them during uninstall if they were defined in a snippet.
|
||||
|
||||
* Fisherman now recognizes the following aliases by default: *i* for install, *u* for update, *l* for list, *s* for search and *h* for help.
|
||||
|
||||
* Rewrite documentation to be simpler and more consistent.
|
||||
|
||||
* Fisherman can install "functions" now. If you have created a function interactively, you can run fisher install `name of the function` and a directory will be created in `$PWD/name of the function` and installed as usual.
|
||||
|
||||
![](https://cloud.githubusercontent.com/assets/8317250/13421665/14e73e12-dfd3-11e5-98a5-88b269ebddd7.gif)
|
||||
|
||||
* Fisherman now detects if users have modified their fish prompt using fish_config and if so, uninstalls $fisher_prompt.
|
||||
|
||||
* Search results now truncate plugin descriptions based in the width of the terminal screen.
|
||||
|
||||
![](https://cloud.githubusercontent.com/assets/8317250/13421733/8885c65e-dfd3-11e5-84f0-e70065b55f70.gif)
|
||||
|
||||
* Install/Update/Uninstall CLI was retouched.
|
||||
|
||||
![cli](https://cloud.githubusercontent.com/assets/8317250/13421788/d3d873c2-dfd3-11e5-9a74-24483d29b6ff.gif)
|
||||
|
||||
|
||||
## [0.9.0][v090] - 2016-02-25
|
||||
|
||||
* Welcome aboard @jethrokuan.
|
||||
|
||||
* The Quickstart Guide is now available in [Chinese](https://github.com/fisherman/fisherman/wiki/快速上手指南), [Russian](https://github.com/fisherman/fisherman/wiki/Краткое-Руководство) and [Korean](https://github.com/fisherman/fisherman/wiki/빠르게-살펴보기). Thanks @pickfire, @denji, @dfdgsdfg.
|
||||
|
||||
* Search now has a color display mode enabled by default when listing records for human consumption, but continues to produce easy to parse output when selecting specific fields.
|
||||
|
||||
The following fisher search --name, fisher search --url, fisher search --name --url, fisher search --tag=prompt --name, and so forth continue to display easy to parse output.
|
||||
|
||||
Queries like fisher search, fisher search --name=fishtape, fisher search --tag=prompt, fisher search --author=joe now display in color by default and support multiple formats using --format described below. The colors used are selected fromm $fish_color_* variables for best results.
|
||||
|
||||
To disable color output, use --no-color. To customize the display format use any of the following keywords:
|
||||
|
||||
* --format=*oneline* (default)
|
||||
* --format=*short*
|
||||
* --format=*verbose*
|
||||
* --format=*longline*
|
||||
* --format=*raw*
|
||||
|
||||
![](https://cloud.githubusercontent.com/assets/8317250/13346476/e477ad56-dca9-11e5-8b73-3546fa517057.gif)
|
||||
|
||||
* Search now shows unique records when listing --authors only. #128
|
||||
|
||||
* Update plugins with merge conflicts by fetching HEAD and applying a hard reset as a last resort. This strategy is only executed on the master branch, other branches are not affected. If branch my-feature is checked out at the time of the update, Fisherman first saves the branch name, checks out master, updates and checks out my-feature again after the operation is complete. #122.
|
||||
|
||||
* Update plugins with a dirty working tree by recording changes in the stash and re-reapplying them again after the git-pull update strategy completes.
|
||||
|
||||
* Improve fisher_name name resolution from paths or URLs accurately. Process names paths such as fisher-plugin-, fisher-theme- as well as other permutations.
|
||||
|
||||
* Make fisher_key_bindings_undo support more complex bind expressions, such as those inside conditional statements. #121.
|
||||
|
||||
* Add more consistent instrumentation / logs.
|
||||
|
||||
* Fix bugs caused by debug calls inside plumbing functions such as fisher_index_update.
|
||||
|
||||
## [0.8.0][v080] - 2016-02-20
|
||||
|
||||
* Welcome aboard @pickfire.
|
||||
|
||||
* Add instrumentation using [debug](https://github.com/fishery/debug). To enable log display add to your config.fish or set at the commandline:
|
||||
|
||||
```fish
|
||||
set -g fish_debug # or set -gx fish_debug
|
||||
```
|
||||
|
||||
The default behavior is to log everything. To filter a specific set of logs add one or more keywords to the fish_debug variable.
|
||||
|
||||
```fish
|
||||
set -gx fish_debug fisher_{install,uninstall}
|
||||
```
|
||||
|
||||
The above will show logs for fisher_install and fisher_uninstsall only. To see what other options are available, see the [documentation](https://github.com/fishery/debug).
|
||||
|
||||
* **Rewrite** the Fisherman installer with a new and improved look and added a TRY_ME mode in which Fisherman is not installed and the installer explains what will be run in the user's machine.
|
||||
|
||||
![Installing Fisherman](https://cloud.githubusercontent.com/assets/8317250/13040276/5f0e5350-d3ed-11e5-8994-3488f80c6494.gif)
|
||||
|
||||
* **Rename** core function wait to spin to reflect usage more accurately and updated its usage across Fisherman accordingly.
|
||||
|
||||
* **Remove** scripts directory in favor of using a functions or the root directory for sharing scripts. Using a scripts directory does not solve the main problem of sharing scripts with the same name, so this addition was deemed of little value. In the future, a more robust way to avoid name collisions when sharing scripts would be nice to have, but at the moment having a scripts directory is not solving this problem but just adding clutter to the configuration. #105.
|
||||
|
||||
* **Update** [website](http://fisherman.sh) to use the new SVG logo. Improve wording. Drop some hardly ever used *.favicons* and switch from SourceCodePro to Monaco style monospace fonts that will load faster as we don't have to include the font sources.
|
||||
|
||||
* **Rename** $fisher_key_bindings variable to $fisher_binds because it's shorter to type and makes config.fish look neater.
|
||||
|
||||
* **Add** user configuration before sourcing Fisherman configuration. #104.
|
||||
|
||||
## [0.7.0][v070] - 2016-02-11
|
||||
|
||||
* Welcome aboard @daenney. If you want to be part of the organization just let [me](https://github.com/bucaran) or @daenney know.
|
||||
|
||||
* Add the ability to install plugins from Gists. You can distribute a very simple, one-single function plugin in the form of a Gist. Your users can install it using fisher install url and Fisherman will query the Gist using the GitHub API to get a list of the Gist files and use the name of the first identified *.fish* file to name the plugin in your system. Since there is no formal way to _name_ a Gist, and you may prefer to keep the "description" field for the actual description and not a name, Fisherman supports only one fish file per Gist. #75.
|
||||
|
||||
* Use command(1) when calling non-builtins. Thanks @daenney. #79.
|
||||
|
||||
* Add fisher_plugin_can_enable to detect installing a prompt that is not the current one. #78.
|
||||
|
||||
* Remove the ability to install a plugin in a parent directory using .. or ../ or even worse, ../../ as well as other combinations that navigate to a parent directory. I find the use case odd at best, and more dangerous that useful. If you want to install a local plugin use the full path or a relative path, always top down. fisher install . or fisher install my/plugin or fisher install /Users/$USER/path/to/plugin. #81.
|
||||
|
||||
## [0.6.0][v060] - 2016-02-07
|
||||
|
||||
* Remove definition of $fisher_index from Fisherman's config.fish. Mostly due to cosmetic reasons and because I would like to isolate the use of the official URL into fisher_index_update alone. You can still redefine this variable and your setting will be favored over the default of 5 second timeout. In addition, fisher_index_update can also take timeout argument that shadows $fisher_timeout. This change is to "guarantee" an index update in some critical cases, for example, downloading the index for the first time should wait as needed in order to make sure Fisherman is installed.
|
||||
|
||||
* Revise the documentation, improve words and grammar. Remove deprecated information, add new API information. Begin to employ a more consistent writing style across manual pages.
|
||||
|
||||
* Fix bug in fisher_plugin_walk that was not generating the correct output for plugin completions.
|
||||
|
||||
* Added new plugin decorator | for plugins that are symbolic links to local projects. These plugins are those installed like fisher install path/to/local/plugin.
|
||||
|
||||
* Improve Install/Update/Uninstall message channels. Before everything, both errors and success information was sent to stderr. Now, the total number of plugins installed/updated/uninstalled is sent to stdout allowing us to parse this output and implement a more robust (and simpler) fisher_deps_install.
|
||||
|
||||
* Add new fisher_plugin_source function to allow plugins to tap into the install mechanism and provider additional features. For example, [autoinit](https://github.com/fishery/autoinit) adds init event support to Fisherman.
|
||||
|
||||
* Tweak validate regex to correctly handle plugins that could be named bb, gh, gl or omf.
|
||||
|
||||
* **spin.fish** Add a single " " space after spinner by default. To remove the white space use a format like --format="@\r".
|
||||
|
||||
* Supress unwated error message when the cache is empty. #66.
|
||||
|
||||
* Add temporary upgrade check to warn users upgrading from < 5.0
|
||||
|
||||
* Create empty fishfile during make install.
|
||||
|
||||
## [0.5.0][v050] - 2016-02-02
|
||||
|
||||
* **Add user key bindings support.** (#42).
|
||||
|
||||
Recall $fisher_home/functions are always before user functions in $fish_function_path. This was an early design decision in order to prevent users from redefining core functions by mistake or by means other than using plugins (recommended). In other words, you are free to create a plugin that modifies a Fisherman core function, but you can't redefine a Fisherman function privately by saving it to your user config fish. If you found a bug in a Fisherman function, instead of creating a private patch send it upstream. If you created a function that overrides a Fisherman core feature, create a plugin. This way the community can benefit from your code whenever you are ready to publish it.
|
||||
|
||||
By default, Fisherman provides no fish_user_key_bindings, so if the user has already defined their own fish_user_key_bindings that one will not be affected.
|
||||
|
||||
Now, plugins **can** define their own key bindings inside a fish_user_key_bindings.fish *or* key_bindings.fish at the root of their repository or inside a functions directory. You can put your key bindings inside a function or not. If you put it inside a function, the function name **must** be the same as the file without the .fish extension.
|
||||
|
||||
+ $fisher_config/bindings.fish
|
||||
|
||||
When a plugin with key bindings is installed for the first time or the only one with bindings is uninstalled, Fisherman will modify ~/.config/functions/fish_user_key_bindings.fish (or create it for the first time) and add a single line at the top of the fish_user_key_bindings function to source the new **$fisher_config/bindings.fish**. All the key bindings defined by the enabled/installed plugins are concatenated and saved to this file.
|
||||
|
||||
This mechanism has the following **advantages**:
|
||||
|
||||
* Does not slow down shell start.
|
||||
* Does not require Fisherman to provide his own fish_user_key_bindings by default.
|
||||
* Honors any previously existing user key bindings.
|
||||
* Allows plugin to define their own key bindings and coexist with the user's key bindings.
|
||||
* If the user updates his fish_user_key_bindings, re-running the function **does** update the key bindings.
|
||||
|
||||
* **Mega Refactoring**
|
||||
|
||||
+ The entire source code of Fisherman received a major revision and refactoring. The validation and install/uninstall mechanisms were thoroughly revised and and broken down into smaller functions easier to test as well as several other sub parts of the system.
|
||||
|
||||
+ Rewrite fisher search and remove features that are mostly already covered by fisher --list and remove the ability to generate information about plugins of unknown origin. The decision to **remove this feature** was based in performance concerns and the result of thinking about the usability and whether it was really worth the speed tradeoff. The conclusion is I would rather have better performance and if I need to query a plugins origin I can always use fisher --list or fisher --list=url or fisher --list=author.
|
||||
|
||||
+ Add $fisher_update_interval to determine if the index should update or not when a search query is taking place. The default value is 10 seconds. This means the index will *not* be updated if less than 10 seconds have elapsed since the last action that triggered an update in the first place. #43.
|
||||
|
||||
+ Improve Install/Uninstall/Update status output. If a plugin fails to install decrease the total. If any plugins are skipped because they are already installed in the case of fisher install or available in the cache, but disabled in the case of fisher uninstall they are collected into an array and displayed in a new section n plugin/s skipped (a, b, c) at the bottom of the report.
|
||||
|
||||
* **Improve test coverage.**
|
||||
|
||||
+ Tightly coupled functions were making testing increasingly difficult. Most of the test effort was basically testing whether git clone or git pull. New separation of concerns makes tests run faster and the difficult install/uninstall algorithms has better coverage now.
|
||||
|
||||
* **Other**
|
||||
|
||||
+ Now fisher_list can list plugins from the _cache_, a _fishfile/bundle_ and plugins that are _installed/enabled_ or _disabled_. This removes fisher_file and combines it with fisher_list. This also removes fisher -f and replaces it with fisher -l <file> or fisher --list=<file>.
|
||||
|
||||
> fisher --list was replaced by fisher list
|
||||
|
||||
+ Rename fisher_parse_help to fisher_complete and have the function create the completions automatically. This allows you to complete your commands with parseable usage help faster. The original design was fine, but this change improves auto-complete performance so it was preferred.
|
||||
|
||||
+ Use fisher_index_update when building file with Make. This helps prevent an error when using a fish version < 2.2.0. #55 #50 #48.
|
||||
|
||||
+ Add fisher_index_update to update the index and remove previously undocumented fisher update --index. This function is designed to bypass GitHub's server network cache passing an arbitrary query string to curl like $fisher_index?RANDOM_NUMBER. This means index updates are immediately available now.
|
||||
|
||||
+ Add fisher --list=url option to display local plugin url or path.
|
||||
|
||||
+ Add fisher --list=bare option to display local plugins in the cache without the * enabled symbol.
|
||||
|
||||
+ Prepend > to the currently enabled theme when using fisher --list[=cache]. Related #49.
|
||||
|
||||
+ Prepend * to plugin names to indicate they are currently enabled when using fisher --list[=cache]. #49.
|
||||
|
||||
## [0.4.0][v040] - 2016-01-11
|
||||
|
||||
* Introducing Fisherman's official website, hosted by GitHub pages.
|
||||
|
||||
   [**http://fisherman.sh**](http://fisherman.sh)
|
||||
|
||||
|
||||
* Refactor fisher install / fisher uninstall by extracting the logic to enable / disable plugins into fisher_plugin_enable. The algorithm to enable/disable plugins is essentially the same. The only difference is _enable_, copies/symlinks files and disable removes them from $fisher_config/.... #45.
|
||||
|
||||
* Add support for legacy Oh My Fish! plugins using .load initialization files. #35.
|
||||
|
||||
* Add support for [Tackle](https://github.com/justinmayer/tackle) Fish framework initialization modules. #35.
|
||||
|
||||
* :gem: :snake: :camel: :penguin: Add support for plugins that share scripts in languages like Python or Perl. For example oh-my-fish/plugin-vi-mode assumes there is a vi-mode-impl.py file in the same path of the running script. This opens the door for including code snippets in other languages.
|
||||
|
||||
* Any py, rb, php, pl, awk or sed files at the root level of a plugin repository, or inside the functions or the new _scripts_ directory are copied to $fisher_config/functions or $fisher_config/scripts.
|
||||
|
||||
* Remove ad-hoc debug d function created by mistake in the Fisherman config.fish file. #34.
|
||||
|
||||
* Remove almost useless fisher --alias. You can still create aliases using $fisher_alias. It's difficult to add auto-complete to this feature, and even if we do so, it is slow.
|
||||
|
||||
* Fix bug introduced in the previous release caused by swapping the lines that calculate the index of the current plugin being installed/updated/uninstalled and the line that displays the value, causing the CLI to show incorrect values. #36. Thanks @kballard
|
||||
|
||||
* Add cache, enabled and disabled options to fisher --list. Now you can type fisher -l enabled to get a list of what plugins are currently enabled.
|
||||
|
||||
* Add new $fisher_plugins universal variable to keep track of what plugins are enabled / disabled.
|
||||
|
||||
* Update completions after a plugin is installed, updated or uninstalled.
|
||||
|
||||
* Improve autocomplete speed by removing the descriptions from plugins installed with custom URLs.
|
||||
|
||||
* fisher --list displays nothing and returns 1 when there are no plugins installed. #38.
|
||||
|
||||
* fisher uninstall does not attempt to uninstall plugins already disabled by looking at the $fisher_plugins array. --force will bypass this. #40
|
||||
|
||||
## [0.3.1][v031] - 2016-01-10
|
||||
|
||||
> This patch contains several amends for 0.3.0 and other minor documentation corrections.
|
||||
|
||||
* Major documentation revision and rewrite.
|
||||
|
||||
* fisher help shows fisher(1) by default now.
|
||||
|
||||
* Fix a critical bug that was causing fisher uninstall --force to remove _not_ the symbolic link, but the actual files. #24
|
||||
|
||||
* Rename orphan tag to custom for plugins installed using a custom URL.
|
||||
|
||||
* Remove fisher --link flag and create symbolic links by default for local paths. The user does not have to worry about symbolic links or whether the copy is as symbolic link or not anymore. If the user tries to install a local path, then the best thing to do is to create a symbolic link. This also eliminates the need to call update.
|
||||
|
||||
* Remove fisher --cache and fisher --validate. Now, that these options are separated into their own function and they are intentionally private, there is no need for them.
|
||||
|
||||
## [0.3.0][v030] - 2016-01-08
|
||||
|
||||
> This release contains several breaking changes a few major improvements. The good news is that the API is starting to look more stable and very unlikely to change drastically again in the future.
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix a critical bug in the Makefile that was incorrectly merging any existing user configuration file and the generated Fisherman configuration. #21.
|
||||
|
||||
* Fix a bug in install and uninstall that was adding plugin names to fishfiles instead of the URL when interacting with custom URLs. Probably closes #23.
|
||||
|
||||
* Fix a bug in install, update and uninstall that was displaying an incorrect plugin count if there was at least on failure.
|
||||
|
||||
* Fix bug in fisher install that causes install to fail even though it succeeds, due to spin(1)'s behavior of returning 1 if there is any output to standard error. #20.
|
||||
|
||||
* Fix bug in fisher uninstall that was removing plugins from the cache by mistake.
|
||||
|
||||
### Add
|
||||
|
||||
* Add feature to Makefile to download the index for the first time in order to provide auto-complete before the user can install/update/search, actions which would case the index to be updated.
|
||||
|
||||
* Add link to Slack [room](http://fisherman-wharf.herokuapp.com/) in README. Thanks @simnalamburt.
|
||||
|
||||
* Add new $fisher_timeout configuration variable that lets you specify curl(1) --max-time option. Without this, curl could hang for a long time if you are in a bad connection.
|
||||
|
||||
* Add fisher install --link to allow installing plugins creating a symbolic link to each of the relevant files to be copied during the install process. If you use --link to install a plugin that is a _path to a directory_ or file, a symbolic link to the directory will be created making local testing more convenient as you are not required to update the plugin's repository to test changes within Fisherman. If you are testing using [Fishtape](https://github.com/fisherman/fishtape) you do not even need to reset the shell session.
|
||||
|
||||
* ~~Add fisher --alias[=<command>=<alias>] to simplify creating new aliases for fisher commands. Use fisher --alias without arguments to list the current set of aliases. Also add auto-complete for aliases to install, update or uninstall. Note that aliases are **not** persisted this way. To save your aliases use $fisher_alias as described in fisher help config. Also note that aliases are only auto-complete if you call fisher --alias. To auto-complete aliases saved to $fisher_alias you can do fisher --alias (fisher --alias).~~
|
||||
|
||||
* Add short options for new and old fisher flags:
|
||||
|
||||
* --file → -f
|
||||
* --list → -l
|
||||
* --alias → -a
|
||||
|
||||
### Improvements
|
||||
|
||||
* Improve help message for failed installs. ##24. @namandistro
|
||||
|
||||
* Improve fisher --validate to automatically correct common misspellings, for example when installing a Oh My Fish! package, one often types ohmyifsh.
|
||||
|
||||
* :point_up: Improve auto-complete performance by extracting the implementation of the different fisher flags to fisher_* functions. completions/fisher.fish relies heavily in fisher_search to query what plugins are available to install/update/uninstall. In this process, numerous calls to fisher --list and fisher --validate, etc., are made. Now, auto-complete does not have to pay the penalty of entering fisher, parsing options, etc. #27. @namandistro
|
||||
|
||||
* Improve fisher --help output and show up until now poorly documented --list, --file, etc. flags consistently. Also display available commands after make install to improve usability.
|
||||
|
||||
* Improve fisher install so that it checks whether the plugin you are trying to install, if it is already in the cache, is a symbolic link or not, and installs it as if the --link flag was specified.
|
||||
|
||||
* Improve fisher --validate to retrieve the absolute path to the closest directory of the given items if they are valid local paths. Related #19.
|
||||
|
||||
* Improve install to not git clone local plugins if a regular path/to/file is given to fisher install. Instead, copy to the cache using cp(1) and if --link is used, create a symlink.
|
||||
|
||||
* Improve fisher --validate to invalidate items with repeated . and - and allow items that begin with / or ./ to support installing plugins from local paths. Related #19.
|
||||
|
||||
## Remove / Rename
|
||||
|
||||
* Modify fisher update default behavior. Now this command updates Fisherman by default. Use of --self and --me is also **deprecated**. To read from the standard input use a dash -. For example: fisher --list | fisher update -. See [Usage of dash in place of a filename](http://unix.stackexchange.com/questions/16357/usage-of-dash-in-place-of-a-filename/16364#16364). #25.
|
||||
|
||||
* Rename --cache to more descriptive --list. Thanks @colstrom.
|
||||
|
||||
* Remove fisher --cache=base and make it return the base names of all directories in the path by default. To get the full path use printf printf "$fisher_cache/%s" (fisher --list)
|
||||
|
||||
* ~~Rename undocumented fisher --translate flag (again) to fisher --cache. This function reads the standard input for a name, URL or local path and calculates the plugin's path relative to the cache. For a name this is simple $fisher_cache/<name>` for an URL, retrieve the remote URL of every repository until there is a match with the given URL and return the path in the cache of that repository. Finally, if the input is a local path of the form file:/// it will pass it as is.~~
|
||||
|
||||
* Revert #3. The reason getopts.fish was in its own file originally is because @bucaran wanted a standalone, dependency free cli parser solution, arguably slightly faster than having Awk read getopts.awk for each use. The performance improvement is negligible at best, but getopts is also used by every single command and future commands and plugins are very likely to use it as well, so we might as well use the slightly faster version.
|
||||
|
||||
## [0.2.0][v020] - 2016-01-05
|
||||
|
||||
* Improve README, added links to screencasts, updated documentation with new changes and fixed other typos and composition errors.
|
||||
|
||||
* Remove fisher update --cache in favor of fisher --list | fisher update and fisher uninstall --all in favor of fisher --list | fisher uninstall.
|
||||
|
||||
* Fisherman does not move initialization / configuration files following the convention name.config.fish to $fisher_config/functions, but to $fisher_config/conf.d now and evaluates each *.config.fish* inside at shell start as usual. #13.
|
||||
|
||||
* ~~Add fisher --cache[=base] option to retrieve contents in $fisher_cache, eliminating flaky usage of find(1)~~. #11.
|
||||
|
||||
* Fisherman now generates information about plugins installed via custom URLs. For the description, a shortened version of the URL is used. For the URL the full URL is used. For tags, the URL is fuzzily checked and tags such as theme, plugin, config and omf are added. The tag ~~_orphan_~~ **custom** is added by default as well. Finally, the author is generated by retrieving the e-mail or username of the author of the first commit in the plugin's repository. #9 and #14.
|
||||
|
||||
* ~~Change --path-in-cache to --translate. This function translates an name or supported URL/URL variation into a path inside $fisher_cache. This allows you to treat plugins installed via custom URLs almost like regular plugins if they are installed. #8.~~
|
||||
|
||||
* Fix a bug where mktemp would fail in some systems. #7. Thanks @tobywf.
|
||||
|
||||
* Add [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md). #6.
|
||||
|
||||
* Fisherman can now unload themes within the same shell, without having to restart the session. #5.
|
||||
|
||||
* Fisherman can now load themes within the same shell, without having to restart the session using exec fish. Shoddy themes, for example those failing to declare global variables with the -g flag still require the session to be reset. See [**related**](https://github.com/oh-my-fish/theme-bobthefish/pull/19). #4.
|
||||
|
||||
* ~~Move getopts implementation to share/getopts.awk.~~ #3.
|
||||
|
||||
* Support dots inside URIs in fisher --validate. #2.
|
||||
|
||||
* Refactor and improve tests for install, update and uninstall.
|
||||
|
||||
## [0.1.0][v010] - 2016-01-01
|
||||
|
||||
* Initial commit.
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[v140]: https://github.com/fisherman/fisherman/releases/tag/1.4.0
|
||||
[v131]: https://github.com/fisherman/fisherman/releases/tag/1.3.1
|
||||
[v130]: https://github.com/fisherman/fisherman/releases/tag/1.3.0
|
||||
[v120]: https://github.com/fisherman/fisherman/releases/tag/1.2.0
|
||||
[v110]: https://github.com/fisherman/fisherman/releases/tag/1.1.0
|
||||
[v100]: https://github.com/fisherman/fisherman/releases/tag/1.0.0
|
||||
[v090]: https://github.com/fisherman/fisherman/releases/tag/0.9.0
|
||||
[v080]: https://github.com/fisherman/fisherman/releases/tag/0.8.0
|
||||
[v070]: https://github.com/fisherman/fisherman/releases/tag/0.7.0
|
||||
[v060]: https://github.com/fisherman/fisherman/releases/tag/0.6.0
|
||||
[v050]: https://github.com/fisherman/fisherman/releases/tag/0.5.0
|
||||
[v040]: https://github.com/fisherman/fisherman/releases/tag/0.4.0
|
||||
[v031]: https://github.com/fisherman/fisherman/releases/tag/0.3.1
|
||||
[v030]: https://github.com/fisherman/fisherman/releases/tag/0.3.0
|
||||
[v020]: https://github.com/fisherman/fisherman/releases/tag/0.2.0
|
||||
[v010]: https://github.com/fisherman/fisherman/releases/tag/0.1.0
|
|
@ -1,27 +0,0 @@
|
|||
# Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [hi@fisherman.sh](mailto:hi@fisherman.sh). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant], version 1.3.0, available at <http://contributor-covenant.org/version/1/3/0/>
|
||||
|
||||
[Contributor Covenant]: http://contributor-covenant.org
|
|
@ -1,33 +0,0 @@
|
|||
[![Slack Room][slack-badge]][slack-link]
|
||||
|
||||
# Contributing
|
||||
|
||||
If you are looking for ways to help, browse [open issues] or send us a PR if you are already working on something.
|
||||
|
||||
## Guidelines
|
||||
|
||||
* Fork the repo and create your feature branch from master.
|
||||
|
||||
* If you make significant changes, please add tests too. Get familiar with [Fishtape].
|
||||
|
||||
* If you've changed APIs, please update the documentation.
|
||||
|
||||
* Follow the [seven rules] of a great Git commit message.
|
||||
|
||||
## Plugins
|
||||
|
||||
1. Create a plugin from a template with [new].
|
||||
2. Submit a plugin to the index with [submit].
|
||||
|
||||
## Translations
|
||||
|
||||
If you would like to translate the documentation, start with the [README].
|
||||
|
||||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
[seven rules]: http://chris.beams.io/posts/git-commit/#seven-rules
|
||||
[open issues]: https://github.com/fisherman/fisherman/issues?q=is%3Aopen+is%3Aissue
|
||||
[Fishtape]: https://github.com/fisherman/fishtape
|
||||
[README]: https://github.com/fisherman/fisherman/blob/master/README.md
|
||||
[new]: https://github.com/fishery/new
|
||||
[submit]: https://github.com/fishery/submit
|
27
LICENSE
27
LICENSE
|
@ -2,20 +2,19 @@ The MIT License (MIT)
|
|||
|
||||
Copyright (c) 2016 Jorge Bucaran
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
383
README.md
383
README.md
|
@ -1,258 +1,259 @@
|
|||
<p align="center">
|
||||
<b>English</b> •
|
||||
<a href="docs/zh-CN">简体中文</a>
|
||||
</p>
|
||||
|
||||
<a name="fisherman"></a>
|
||||
[![play]][play-link]
|
||||
<h4 align="center">
|
||||
<br>
|
||||
<br>
|
||||
<a href="http://fisherman.sh"><img
|
||||
alt="fisherman"
|
||||
width=800px
|
||||
src="https://rawgit.com/fisherman/logo/master/fisherman-black-white.svg"></a>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</h4>
|
||||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
[![fisherman Version][version-badge]][version-link]
|
||||
[![Slack Room][slack-badge]][slack-link]
|
||||
[![Slack][slack-badge]][slack-link]
|
||||
|
||||
# [fisherman] - fish shell plugin manager
|
||||
|
||||
fisherman is a zero-configuration, concurrent plugin manager for the [fish shell].
|
||||
|
||||
Read this document in another language: [Español], [日本語], [简体中文].
|
||||
|
||||
## Why?
|
||||
|
||||
* Simple
|
||||
|
||||
* No configuration
|
||||
|
||||
* No external dependencies
|
||||
|
||||
* No impact on shell startup time
|
||||
|
||||
* Use it interactively or _a la_ vundle
|
||||
|
||||
* Only the essentials, install, update, remove, list and help
|
||||
|
||||
## Install
|
||||
|
||||
```fish
|
||||
curl -sL get.fisherman.sh | fish
|
||||
Copy `fisher.fish` into your `~/.config/fish/functions` directory and that's it.
|
||||
|
||||
```sh
|
||||
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Install plugins.
|
||||
Install a plugin.
|
||||
|
||||
```
|
||||
fisher i fishtape shark get bobthefish
|
||||
fisher simple
|
||||
```
|
||||
|
||||
Install Oh My Fish! plugins.
|
||||
Install from multiple sources.
|
||||
|
||||
```fish
|
||||
fisher i omf/plugin-{percol,jump,fasd}
|
||||
```
|
||||
fisher z fzf omf/{grc,thefuck}
|
||||
```
|
||||
|
||||
Install a plugin from a local directory.
|
||||
Install from a URL.
|
||||
|
||||
```fish
|
||||
fisher i ./path/to/plugin
|
||||
```
|
||||
fisher https://github.com/edc/bass
|
||||
```
|
||||
|
||||
Install a plugin from various URLs.
|
||||
Install from a gist.
|
||||
|
||||
```fish
|
||||
fisher i https://github.com/some/plugin another/plugin bb:one/more
|
||||
```
|
||||
fisher https://gist.github.com/username/1f40e1c6e0551b2666b2
|
||||
```
|
||||
|
||||
Install a plugin from a Gist.
|
||||
Install from a local directory.
|
||||
|
||||
```fish
|
||||
fisher i gist.github.com/owner/1f40e1c6e0551b2666b2
|
||||
```sh
|
||||
fisher ~/my_aliases
|
||||
```
|
||||
|
||||
Use it a la vundle. Edit your fishfile and run `fisher` to satisfy changes.
|
||||
|
||||
> [What is a fishfile and how do I use it?](#9-what-is-a-fishfile-and-how-do-i-use-it)
|
||||
|
||||
```sh
|
||||
$EDITOR fishfile # add plugins
|
||||
fisher
|
||||
```
|
||||
|
||||
See what's installed.
|
||||
|
||||
```
|
||||
fisher ls
|
||||
@ my_aliases # this plugin is a local directory
|
||||
* simple # this plugin is the current prompt
|
||||
bass
|
||||
fzf
|
||||
grc
|
||||
thefuck
|
||||
z
|
||||
```
|
||||
|
||||
Update everything.
|
||||
|
||||
```
|
||||
fisher u
|
||||
fisher up
|
||||
```
|
||||
|
||||
Update plugins.
|
||||
Update some plugins.
|
||||
|
||||
```
|
||||
fisher u shark get
|
||||
fisher up bass z fzf thefuck
|
||||
```
|
||||
|
||||
Uninstall plugins.
|
||||
Remove plugins.
|
||||
|
||||
```
|
||||
fisher uninstall fishtape debug
|
||||
fisher rm simple
|
||||
```
|
||||
|
||||
|
||||
## List and search
|
||||
|
||||
The list command displays all the plugins you have installed. The search command queries the index to show what's available to install.
|
||||
|
||||
List installed plugins.
|
||||
Remove all the plugins.
|
||||
|
||||
```
|
||||
fisher list
|
||||
debug
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ wipe
|
||||
fisher ls | fisher rm
|
||||
```
|
||||
|
||||
Search the index.
|
||||
Get help.
|
||||
|
||||
```
|
||||
fisher search
|
||||
...
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> superman Powerline prompt based on Superman
|
||||
...
|
||||
fisher help z
|
||||
```
|
||||
|
||||
Query the index using regular expressions.
|
||||
## FAQ
|
||||
|
||||
```
|
||||
fisher search --name~/git-is/
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
```
|
||||
### 1. What fish version is required?
|
||||
|
||||
Search using tags.
|
||||
|
||||
```
|
||||
fisher search --tag={git,test}
|
||||
...
|
||||
* fishtape TAP producing test runner
|
||||
git-branch-name Get the name of the current Git branch
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
...
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
* `>` The plugin is a prompt
|
||||
* `*` The plugin is installed
|
||||
* `@` The plugin is a symbolic link
|
||||
|
||||
|
||||
## Plumbing
|
||||
|
||||
fisherman commands are pipe aware. Plumb one with another to create complex functionality.
|
||||
|
||||
Update plugins installed as symbolic links.
|
||||
fisherman was built for the latest fish, but at least 2.2.0 is required. If you can't upgrade your build, append the following code to your `~/.config/fish/config.fish` for [snippet](#12-what-is-a-plugin) support.
|
||||
|
||||
```fish
|
||||
fisher list --link | fisher update -
|
||||
for file in ~/.config/fish/conf.d/*.fish
|
||||
source $file
|
||||
end
|
||||
```
|
||||
|
||||
Enable all the plugins currently disabled.
|
||||
### 2. How do I install fish on OS X?
|
||||
|
||||
With Homebrew.
|
||||
|
||||
```
|
||||
brew install fish
|
||||
```
|
||||
|
||||
### 3. How do I install the latest fish on some Linux?
|
||||
|
||||
With git, from the source.
|
||||
|
||||
```sh
|
||||
sudo apt-get -y install git gettext automake autoconf \
|
||||
ncurses-dev build-essential libncurses5-dev
|
||||
|
||||
git clone -q --depth 1 https://github.com/fish-shell/fish-shell
|
||||
cd fish-shell
|
||||
autoreconf && ./configure
|
||||
make && sudo make install
|
||||
```
|
||||
|
||||
### 4. How do I use fish as my default shell?
|
||||
|
||||
Add fish to the list of login shells in `/etc/shells` and make it your default shell.
|
||||
|
||||
```sh
|
||||
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
|
||||
chsh -s /usr/local/bin/fish
|
||||
```
|
||||
|
||||
### 5. How do I uninstall fisherman?
|
||||
|
||||
Run
|
||||
|
||||
```fish
|
||||
fisher list --disabled | fisher install
|
||||
fisher self-uninstall
|
||||
```
|
||||
|
||||
Uninstall all the plugins and remove them from the cache.
|
||||
### 6. Is fisherman compatible with oh my fish themes and plugins?
|
||||
|
||||
Yes.
|
||||
|
||||
### 7. Why fisherman? Why not ____?
|
||||
|
||||
fisherman has / is:
|
||||
|
||||
* small and fits in one file
|
||||
|
||||
* zero impact on shell startup time
|
||||
|
||||
* fast and easy to install, update and uninstall
|
||||
|
||||
* no need to edit your fish configuration
|
||||
|
||||
* correct usage of the XDG base directory spec
|
||||
|
||||
### 8. Where does fisherman put stuff?
|
||||
|
||||
fisherman goes in `~/.config/fish/functions/fisher.fish`.
|
||||
|
||||
The cache and plugin configuration is created in `~/.cache/fisherman` and `~/.config/fisherman` respectively.
|
||||
|
||||
The fishfile is saved to `~/.config/fish/fishfile`.
|
||||
|
||||
### 9. What is a fishfile and how do I use it?
|
||||
|
||||
The fishfile `~/.config/fish/fishfile` lists all the installed plugins.
|
||||
|
||||
You can let fisherman take care of this file for you automatically, or write in the plugins you want and run `fisher` to satisfy the changes.
|
||||
|
||||
```
|
||||
fisherman/simple
|
||||
fisherman/z
|
||||
omf/thefuck
|
||||
omf/grc
|
||||
```
|
||||
|
||||
This mechanism only installs plugins and missing dependencies. To remove a plugin, use `fisher rm` instead.
|
||||
|
||||
### 10. Where can I find a list of fish plugins?
|
||||
|
||||
Browse the [organization] or use the [online] search to discover content.
|
||||
|
||||
### 11. How do I upgrade from ____?
|
||||
|
||||
fisherman does not interfere with any known frameworks. If you want to uninstall oh my fish, refer to their documentation.
|
||||
|
||||
### 12. What is a plugin?
|
||||
|
||||
A plugin is:
|
||||
|
||||
1. a directory or git repo with a function `.fish` file either at the root level of the project or inside a `functions` directory
|
||||
|
||||
2. a theme or prompt, i.e, a `fish_prompt.fish`, `fish_right_prompt.fish` or both files
|
||||
|
||||
3. a snippet, i.e, one or more `.fish` files inside a directory named `conf.d` that are evaluated by fish at the start of the shell
|
||||
|
||||
### 13. How can I list plugins as dependencies to my plugin?
|
||||
|
||||
Create a new `fishfile` file at the root level of your project and write in the plugin dependencies.
|
||||
|
||||
```fish
|
||||
fisher list | fisher uninstall --force
|
||||
owner/repo
|
||||
https://github.com/dude/sweet
|
||||
https://gist.github.com/bucaran/c256586044fea832e62f02bc6f6daf32
|
||||
```
|
||||
|
||||
## Bundle
|
||||
### 14. What about fundle?
|
||||
|
||||
When you install a plugin, fisherman updates the *bundle* file to track what plugins are currently active.
|
||||
fundle inspired me to use a bundle file, but it still has limited capabilities and requires you to modify your fish configuration.
|
||||
|
||||
* Customize the location of the bundle.
|
||||
### 15. I have a question or request not addressed here. Where should I put it?
|
||||
|
||||
```fish
|
||||
set -g fisher_file ~/.dotfiles/bundle
|
||||
```
|
||||
Create a new ticket on the issue tracker:
|
||||
|
||||
## Flat tree
|
||||
* https://github.com/fisherman/fisherman/issues
|
||||
|
||||
fisherman merges the directory trees of all the plugins it installs into a single flat tree. Since the flat tree is loaded only once at the start of the shell, fisherman performs equally well, regardless of the number of plugins installed.
|
||||
|
||||
The following illustrates an example fisherman configuration path with a single plugin and prompt.
|
||||
[fish shell]: https://github.com/fish-shell/fish-shell
|
||||
[fisherman]: https://github.com/fisherman.sh
|
||||
[organization]: https://github.com/fisherman
|
||||
[online]: http://fisherman.sh/#search
|
||||
|
||||
```
|
||||
$fisher_config
|
||||
├── cache
|
||||
├── completions
|
||||
│ └── my_plugin.fish
|
||||
├── conf.d
|
||||
│ └── my_plugin.fish
|
||||
├── bundle
|
||||
├── functions
|
||||
│ ├── fish_prompt.fish
|
||||
│ ├── fish_right_prompt.fish
|
||||
│ └── my_plugin.fish
|
||||
└── man
|
||||
└── man1
|
||||
└── my_plugin.1
|
||||
```
|
||||
|
||||
## Index
|
||||
|
||||
The index is a plain text database that lists fisherman official plugins.
|
||||
|
||||
The index lists records, each consisting the fields: *name*, *url*, *info*, one or more *tags* and *author*.
|
||||
|
||||
```
|
||||
z
|
||||
https://github.com/fisherman/z
|
||||
Pure-fish z directory jumping
|
||||
z search cd jump
|
||||
jethrokuan
|
||||
```
|
||||
|
||||
If you have a plugin you would like to submit to the index, send us a PR here [index](https://github.com/fisherman/index) repository.
|
||||
|
||||
```
|
||||
git clone https://github.com/fisherman/index
|
||||
cd index
|
||||
echo "$name\n$url\n$info\n$tags\n$author\n\n" >> index
|
||||
git push origin master
|
||||
```
|
||||
|
||||
## Variables
|
||||
|
||||
* $fisher_home:
|
||||
The home directory. If you installed fisherman using the recommended method, the location ought to be *XDG_DATA_HOME/fisherman*.
|
||||
|
||||
* $fisher_config:
|
||||
The configuration directory. This is default location of your *bundle*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* directories. *XDG_CONFIG_HOME/fisherman* by default.
|
||||
|
||||
* $fisher_file:
|
||||
The location of the bundle file.
|
||||
|
||||
* $fisher_cache:
|
||||
The cache directory. Plugins are downloaded to this location.
|
||||
|
||||
* $fisher_alias *command*=*alias* ...:
|
||||
Use this variable to create aliases of fisherman commands.
|
||||
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
|
||||
[version-badge]: https://img.shields.io/badge/latest-v1.5.0-00B9FF.svg?style=flat-square
|
||||
[version-link]: https://github.com/fisherman/fisherman/releases
|
||||
|
||||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
|
||||
[play]: https://cloud.githubusercontent.com/assets/8317250/14401577/14411b12-fe51-11e5-8d5a-bb054edfc2d4.png
|
||||
[play-link]: http://fisherman.sh/#demo
|
||||
|
||||
[Plugins]: http://fisherman.sh/#search
|
||||
[fish]: https://github.com/fish-shell/fish-shell
|
||||
|
||||
[other]: https://github.com/fisherman/fisherman/wiki/Installing-fisherman#notes
|
||||
[fisherman]: http://fisherman.sh
|
||||
[Español]: docs/es-ES
|
||||
[简体中文]: docs/zh-CN
|
||||
[日本語]: docs/jp-JA
|
||||
|
|
19
THANKS.md
19
THANKS.md
|
@ -1,19 +0,0 @@
|
|||
# Thank You
|
||||
|
||||
The following individuals have contributed to Fisherman.
|
||||
|
||||
* [Daniele Sluijters](https://github.com/daenney)
|
||||
* [Daniel Maslowski](https://github.com/orangecms)
|
||||
* [Daniel Perez](https://github.com/tuvistavie)
|
||||
* [Denis Denisov](https://github.com/denji)
|
||||
* [Hyeon Kim](https://github.com/simnalamburt)
|
||||
* [Ian](https://github.com/ViViDboarder)
|
||||
* [Ivan Tham](https://github.com/pickfire)
|
||||
* [Jethro Kuan](https://github.com/jethrokuan)
|
||||
* [Jon Scott](https://github.com/jonscottclark)
|
||||
* [Jorge Bucaran](https://github.com/bucaran)
|
||||
* [Kevin Ballard](https://github.com/kballard)
|
||||
* [Mizuki](https://github.com/zukif)
|
||||
* [Patrick Callahan](https://github.com/therealpxc)
|
||||
* [Seunggi Kim](https://github.com/dfdgsdfg)
|
||||
* [Yang Bingwu](https://github.com/detailyang)
|
1
VERSION
1
VERSION
|
@ -1 +0,0 @@
|
|||
1.5.0
|
183
bin/install
183
bin/install
|
@ -1,183 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
function __fisher_format_source_safe
|
||||
if not command fish_indent $argv ^ /dev/null
|
||||
command fish_indent
|
||||
end
|
||||
end
|
||||
|
||||
function __fisher_home_humanize
|
||||
set -l tilde "$fisher_color_param~$fisher_color_close"
|
||||
sed "s|$HOME|$tilde|"
|
||||
end
|
||||
|
||||
function __fisher_run_commands -a message commands
|
||||
set -l fish_debug_copy $fish_debug
|
||||
set fish_debug
|
||||
|
||||
set -l tmp (mktemp -t fisherman.XXX)
|
||||
|
||||
fish -c "$commands" > /dev/null ^ $tmp &
|
||||
|
||||
while true
|
||||
for spinner in ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏
|
||||
set -l message (printf "%s\n" $message | __fisher_home_humanize)
|
||||
printf " $fisher_color_param$spinner$fisher_color_close $message\r"
|
||||
sleep 0.05
|
||||
end
|
||||
|
||||
set -l last_job (jobs -l | command awk -v FS=\t '
|
||||
/[0-9]+\t/{
|
||||
jobs[++job_count] = $1
|
||||
}
|
||||
|
||||
END {
|
||||
for (i = 1; i <= job_count; i++) {
|
||||
print(jobs[i])
|
||||
}
|
||||
|
||||
exit job_count == 0
|
||||
}
|
||||
')
|
||||
|
||||
if test -z "$last_job"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if test -s $tmp
|
||||
cat $tmp
|
||||
|
||||
printf "\r $fisher_error_symbol\n\n"
|
||||
|
||||
printf "Sorry, but I couldn't install fisherman. Some things you can try:\n\n"
|
||||
|
||||
printf "%s\n" " $fisher_arrow_symbol Upgrade your Git version (^2.0)"
|
||||
printf "%s\n" " $fisher_arrow_symbol Upgrade your Fish version (^2.2.0)"
|
||||
printf "%s\n" " $fisher_arrow_symbol Make sure you can write to $fisher_home"
|
||||
printf "%s\n"
|
||||
printf "%s\n" "For more help visit "$fisher_color_uline"http://issues.fisherman.sh$fisher_color_close"
|
||||
|
||||
command rm -f $tmp
|
||||
|
||||
set fish_debug $fish_debug_copy
|
||||
|
||||
exit 1
|
||||
end
|
||||
|
||||
set fish_debug $fish_debug_copy
|
||||
|
||||
command rm -f $tmp
|
||||
|
||||
printf "\r $fisher_check_symbol \n"
|
||||
end
|
||||
|
||||
function __fisher_install_fisherman
|
||||
set xdg_home ~/.local/share
|
||||
set xdg_config ~/.config
|
||||
|
||||
if test ! -z "$XDG_DATA_HOME"
|
||||
set xdg_home "$XDG_DATA_HOME"
|
||||
end
|
||||
|
||||
if test ! -z "$XDG_CONFIG_HOME"
|
||||
set xdg_config "$XDG_CONFIG_HOME"
|
||||
end
|
||||
|
||||
set fisher_home "$xdg_home/fisherman"
|
||||
set fisher_config "$xdg_config/fisherman"
|
||||
set fish_config "$xdg_config/fish"
|
||||
|
||||
if test ! -z "$FISHER_HOME"
|
||||
set fisher_home "$FISHER_HOME"
|
||||
end
|
||||
|
||||
if test ! -z "$FISHER_CONFIG"
|
||||
set fisher_config "$FISHER_CONFIG"
|
||||
end
|
||||
|
||||
set -l config "$fish_config/config.fish"
|
||||
|
||||
if test -d $fisher_home
|
||||
printf " $fisher_error_symbol %s\n\n" "fisherman is already installed. To reinstall:"
|
||||
|
||||
printf " $fisher_arrow_symbol %s\n" "Remove $fisher_home" \
|
||||
| __fisher_home_humanize
|
||||
|
||||
if test -s $config
|
||||
printf " $fisher_arrow_symbol %s\n" "Remove this configuration from $fish_config" \
|
||||
| __fisher_home_humanize
|
||||
|
||||
printf "%s\n"
|
||||
set -l indent " "
|
||||
grep "fisher" $config | __fisher_format_source_safe --ansi | sed "s/^/ $indent /"
|
||||
|
||||
set_color normal
|
||||
end
|
||||
|
||||
printf "\n%s\n" "For more help visit "$fisher_color_uline"http://issues.fisherman.sh$fisher_color_close"
|
||||
|
||||
exit 1
|
||||
end
|
||||
|
||||
if test "$version" = 2.1.2
|
||||
printf "%s\n" (set_color ff0
|
||||
)" • Please upgrade to fish 2.2.0 for best results.$fisher_color_close"
|
||||
end
|
||||
|
||||
__fisher_run_commands \
|
||||
"Downloading fisherman to $fisher_home" \
|
||||
"git clone --quiet --depth 1 $fisher_remote_uri $fisher_home"
|
||||
|
||||
|
||||
set -l home ~
|
||||
|
||||
__fisher_run_commands \
|
||||
"Installing fisherman to $fisher_config" \
|
||||
"
|
||||
set -e fish_greeting
|
||||
|
||||
mkdir -p $fisher_config/{cache,functions,completions,conf.d,man}
|
||||
|
||||
mkdir -p $fish_config
|
||||
pushd $fish_config
|
||||
|
||||
touch config.fish
|
||||
|
||||
echo 'set -g fisher_home $fisher_home' | sed 's|/\$||;s|$home|~|' >> fisherconf
|
||||
echo 'set -g fisher_config $fisher_config' | sed 's|$home|~|' >> fisherconf
|
||||
echo 'source \$fisher_home/config.fish' >> fisherconf
|
||||
|
||||
command awk 'FNR==NR{ print; a[\$0]; next } !(\$0 in a) || /^\$/' config.fish fisherconf > config.fish.tmp
|
||||
command mv config.fish.tmp config.fish
|
||||
command rm fisherconf
|
||||
|
||||
fish -c '__fisher_index_update 0'
|
||||
"
|
||||
|
||||
set -l gray (set_color aaa)
|
||||
|
||||
printf " $fisher_check_symbol ""$gray"" Done! Enter $fisherman""``fisher``""$fisher_color_close ""$gray""to get started\n\n"
|
||||
|
||||
printf " $fisher_arrow_symbol Plugins "$fisher_color_uline"http://plugins.fisherman.sh$fisher_color_close\n"
|
||||
printf " $fisher_arrow_symbol Community "$fisher_color_uline"http://slack.fisherman.sh$fisher_color_close\n"
|
||||
|
||||
if set -q CI
|
||||
exit
|
||||
end
|
||||
|
||||
exec fish < /dev/tty
|
||||
end
|
||||
|
||||
set -g fisher_color_param (set_color green)
|
||||
set -g fisher_color_uline (set_color -u)
|
||||
set -g fisher_color_error (set_color red)
|
||||
set -g fisher_color_close (set_color normal)
|
||||
|
||||
set -g fisher_check_symbol $fisher_color_param"✔"$fisher_color_close
|
||||
set -g fisher_error_symbol $fisher_color_error"✘"$fisher_color_close
|
||||
set -g fisher_arrow_symbol $fisher_color_param"▸"$fisher_color_close
|
||||
|
||||
set -g fisher_remote_uri "https://github.com/fisherman/fisherman"
|
||||
|
||||
__fisher_install_fisherman
|
|
@ -1,37 +0,0 @@
|
|||
set -l IFS ";"
|
||||
|
||||
complete -xc fisher
|
||||
complete -c fisher -a "fisherman" -d "Update Fisherman" -n "__fish_seen_subcommand_from update"
|
||||
complete -c fisher -a "tutorial" -d "An introduction to Fisherman" -n "__fish_seen_subcommand_from help"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Show usage help"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
|
||||
|
||||
complete -c fisher -a "plugin" -d "Plugin template" -n "__fish_seen_subcommand_from new"
|
||||
complete -c fisher -a "command" -d "Fisherman command template" -n "__fish_seen_subcommand_from new"
|
||||
complete -c fisher -a "prompt" -d "Prompt/Theme template" -n "__fish_seen_subcommand_from new"
|
||||
complete -c fisher -a "snippet" -d "Snippet template" -n "__fish_seen_subcommand_from new"
|
||||
|
||||
__fisher_help_commands | while read -l command info
|
||||
complete -c fisher -n "__fish_use_subcommand" -a $command -d "$info"
|
||||
complete -c fisher -n "__fish_seen_subcommand_from help" -a $command -d "$info"
|
||||
eval fisher_$command -h | __fisher_complete fisher $command
|
||||
end
|
||||
|
||||
set -l plugins (
|
||||
if test -s $fisher_file
|
||||
__fisher_file < $fisher_file | __fisher_name
|
||||
end
|
||||
)
|
||||
|
||||
begin
|
||||
awk -F '\n' -v RS='' -v OFS=';' ' { print $1, $3 } ' $fisher_cache/.index ^ /dev/null
|
||||
__fisher_cache_list
|
||||
|
||||
end | sort -ut ';' -k1,1 | while read -l name info
|
||||
|
||||
if contains -- $name $plugins
|
||||
complete -c fisher -n "__fish_seen_subcommand_from u update uninstall" -a "$name" -d "$info"
|
||||
else
|
||||
complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info"
|
||||
end
|
||||
end
|
|
@ -1 +0,0 @@
|
|||
complete -xc getopts -a '\t'
|
|
@ -1,2 +0,0 @@
|
|||
set -l IFS \t
|
||||
spin -h | __fisher_complete spin
|
10
config.fish
10
config.fish
|
@ -1,10 +0,0 @@
|
|||
set -g fisher_file $fisher_config/fishfile
|
||||
set -g fisher_cache $fisher_config/cache
|
||||
set -g fisher_binds $fisher_config/key_bindings.fish
|
||||
|
||||
set -g fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path
|
||||
set -g fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||
|
||||
for file in $fisher_config/conf.d/*.fish
|
||||
source $file
|
||||
end
|
BIN
docs/.DS_Store
vendored
Normal file
BIN
docs/.DS_Store
vendored
Normal file
Binary file not shown.
258
docs/es-ES/README.md
Normal file
258
docs/es-ES/README.md
Normal file
|
@ -0,0 +1,258 @@
|
|||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
[![Slack][slack-badge]][slack-link]
|
||||
|
||||
# [fisherman] - fish shell plugin manager
|
||||
|
||||
fisherman es un gestionador de paquetes para el [fish shell] de procesamiento en paralelo libre de configuración.
|
||||
|
||||
Lee este documento en otro idioma: [English], [日本語], [简体中文].
|
||||
|
||||
## Motivo
|
||||
|
||||
* Simple
|
||||
|
||||
* Sin configuración
|
||||
|
||||
* Sin dependencias externas
|
||||
|
||||
* No influye en el tiempo de inicio de la sesión
|
||||
|
||||
* Se puede utilizar de manera interactiva o _a la_ vundle
|
||||
|
||||
* Solo lo fundamental, install, update, remove, list y help
|
||||
|
||||
## Instalación
|
||||
|
||||
Copia `fisher.fish` en `~/.config/fish/functions` y listo.
|
||||
|
||||
```sh
|
||||
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman
|
||||
```
|
||||
|
||||
## Uso
|
||||
|
||||
Instala paquetes.
|
||||
|
||||
```
|
||||
fisher simple
|
||||
```
|
||||
|
||||
Instala de múltiples fuentes.
|
||||
|
||||
```
|
||||
fisher z fzf omf/{grc,thefuck}
|
||||
```
|
||||
|
||||
Instala URLs.
|
||||
|
||||
```
|
||||
fisher https://github.com/edc/bass
|
||||
```
|
||||
|
||||
Instala gists.
|
||||
|
||||
```
|
||||
fisher https://gist.github.com/username/1f40e1c6e0551b2666b2
|
||||
```
|
||||
|
||||
Instala un directorio.
|
||||
|
||||
```sh
|
||||
fisher ~/my_aliases
|
||||
```
|
||||
|
||||
A la vundle. Edita el fishfile y entra `fisher` para satisfacer los cambios.
|
||||
|
||||
> [¿Qué es el fishfile y cómo lo utilizo?](#9-qué-es-el-fishfile-y-cómo-lo-uso)
|
||||
|
||||
```sh
|
||||
$EDITOR fishfile # añade paquetes
|
||||
fisher
|
||||
```
|
||||
|
||||
Muestra que está instalado actualmente.
|
||||
|
||||
```
|
||||
fisher ls
|
||||
@ my_aliases # este paquete es un directorio
|
||||
* simple # este paquete es el tema actual
|
||||
bass
|
||||
fzf
|
||||
grc
|
||||
thefuck
|
||||
z
|
||||
```
|
||||
|
||||
Actualiza todo.
|
||||
|
||||
```
|
||||
fisher up
|
||||
```
|
||||
|
||||
Actualiza algunos paquetes.
|
||||
|
||||
```
|
||||
fisher up bass z fzf thefuck
|
||||
```
|
||||
|
||||
Elimina paquetes.
|
||||
|
||||
```
|
||||
fisher rm simple
|
||||
```
|
||||
|
||||
Elimina todos los paquetes.
|
||||
|
||||
```
|
||||
fisher ls | fisher rm
|
||||
```
|
||||
|
||||
Muestra ayuda.
|
||||
|
||||
```
|
||||
fisher help z
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### 1. ¿Qué versión de fish se requiere?
|
||||
|
||||
fisherman está diseñado para el último fish, pero se requiere 2.0.0 mínimo. Si no puedes actualizar fish, añade este código a `~/.config/fish/config.fish` para poder ejecutar [snippets](#13-qué-es-un-paquete).
|
||||
|
||||
```fish
|
||||
for file in ~/.config/fish/conf.d/*.fish
|
||||
source $file
|
||||
end
|
||||
```
|
||||
|
||||
### 2. ¿Cómo puedo instalar fish en OS X?
|
||||
|
||||
Via Homebrew.
|
||||
|
||||
```
|
||||
brew install fish
|
||||
```
|
||||
|
||||
### 3. ¿Cómo puedo instalar el útlimo fish en algunos Linux?
|
||||
|
||||
Via git, compilando el código.
|
||||
|
||||
```sh
|
||||
sudo apt-get -y install git gettext automake autoconf \
|
||||
ncurses-dev build-essential libncurses5-dev
|
||||
|
||||
git clone -q --depth 1 https://github.com/fish-shell/fish-shell
|
||||
cd fish-shell
|
||||
autoreconf && ./configure
|
||||
make && sudo make install
|
||||
```
|
||||
|
||||
### 4. ¿Cómo hago fish mi shell por defecto?
|
||||
|
||||
Añade fish a la lista de login shells in `/etc/shells`.
|
||||
|
||||
```sh
|
||||
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
|
||||
chsh -s /usr/local/bin/fish
|
||||
```
|
||||
|
||||
### 5. ¿Cómo puedo desinstalar fisherman?
|
||||
|
||||
Entra
|
||||
|
||||
```fish
|
||||
fisher self-uninstall
|
||||
```
|
||||
|
||||
### 6. ¿Es fisherman compatible con paquetes y temas de oh my fish?
|
||||
|
||||
Sí.
|
||||
|
||||
### 7. ¿Por qué fisherman? ¿Por qué no ____?
|
||||
|
||||
fisherman tiene / es:
|
||||
|
||||
* Diminuto y cabe en un solo archivo
|
||||
|
||||
* No influye en el tiempo de inicio de la sesión
|
||||
|
||||
* Rápido y fácil de instalar, actualizar y desinstalar
|
||||
|
||||
* No requiere modificar tu configuración de fish
|
||||
|
||||
* Usa el sistema XDG de directions base correctamente
|
||||
|
||||
### 8. ¿Dónde guarda fisherman las cosas?
|
||||
|
||||
fisherman mismo va en `~/.config/fish/functions/fisher.fish`.
|
||||
|
||||
El caché y la configuración en `~/.cache/fisherman` y `~/.config/fisherman` respectivamente.
|
||||
|
||||
El fishfile en `~/.config/fish/fishfile`.
|
||||
|
||||
### 9. ¿Qué es el fishfile y cómo lo uso?
|
||||
|
||||
El fishfile `~/.config/fish/fishfile` registra todos los paquetes que están instalados.
|
||||
|
||||
Puedes dejar que fisherman se encargue de este archivo automáticamente, o ingresar los paquetes que requieres y entrar `fisher` para satisfacer los cambios.
|
||||
|
||||
```
|
||||
fisherman/simple
|
||||
fisherman/z
|
||||
omf/thefuck
|
||||
omf/grc
|
||||
```
|
||||
|
||||
Este mecanismo solo instala paquetes y dependecias necesarias. Para remover paquetes, usa `fisher rm`.
|
||||
|
||||
### 10. ¿Dónde consigo las lista de paquetes para fish?
|
||||
|
||||
Diríjete a la [organización] o usa la búsqueda [en línea] para descrubir contenido.
|
||||
|
||||
### 11. ¿Cómo puedo migrar desde ____?
|
||||
|
||||
fisherman no interfiere con otros sistemas conocidos. Si quieres desinstalar oh my fish, diríjete a su documentación
|
||||
|
||||
### 13. ¿Qué es un paquete?
|
||||
|
||||
Un paquete es:
|
||||
|
||||
1. un directorio o repositorio de git con una función / archivo `.fish` bien sea en el nivel raíz del proyecto o en un directorio llamado `functions`.
|
||||
|
||||
2. un tema o prompt, es decir, `fish_prompt.fish`, `fish_right_prompt.fish` o ambos.
|
||||
|
||||
3. un snippet, es decir, uno o más archivos `.fish` en un directorio llamado `conf.d` que son ejecutados por fish al inicio de la sesión.
|
||||
|
||||
### 14. ¿Cómo puedo añadir dependencias a mi plugin?
|
||||
|
||||
Crea un `fishfile` en el nivel raíz de tu proyecto y escribe los paquetes.
|
||||
|
||||
```fish
|
||||
owner/repo
|
||||
https://github.com/dude/sweet
|
||||
https://gist.github.com/bucaran/c256586044fea832e62f02bc6f6daf32
|
||||
```
|
||||
|
||||
### 15. ¿Qué puedes decir de fundle?
|
||||
|
||||
fundle fue la inspiración para utilizar el fishfile, pero todavía es limitado en sus capacidades y hace requisito modificar la configuración de fish.
|
||||
|
||||
### 16. Tengo una pregunta que no aparece aquí. ¿Dónde pregunto?
|
||||
|
||||
Crea un nuevo ticket en el issue tracker:
|
||||
|
||||
* https://github.com/fisherman/fisherman/issues
|
||||
|
||||
[fish shell]: https://github.com/fish-shell/fish-shell
|
||||
[fisherman]: https://github.com/fisherman.sh
|
||||
[organización]: https://github.com/fisherman
|
||||
[en línea]: http://fisherman.sh/#search
|
||||
|
||||
[English]: ../../README.md
|
||||
[简体中文]: docs/zh-CN
|
||||
[日本語]: docs/jp-JA
|
18
docs/jp-JA/README.md
Normal file
18
docs/jp-JA/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
[![Slack][slack-badge]][slack-link]
|
||||
|
||||
# [fisherman] - fish shell plugin manager
|
||||
|
||||
[fisherman]: http://fisherman.sh
|
||||
[fish shell]: https://github.com/fish-shell/fish-shell
|
||||
[organization]: https://github.com/fisherman
|
||||
[online]: http://fisherman.sh/#search
|
||||
|
||||
[English]: ../../README.md
|
||||
[Español]: docs/es-ES
|
||||
[简体中文]: docs/zh-CN
|
|
@ -1,254 +1,18 @@
|
|||
<p align="center">
|
||||
<a href="../../README.md">English</a> •
|
||||
<b>简体中文</b>
|
||||
</p>
|
||||
|
||||
<a name="fisherman"></a>
|
||||
[![play]][play-link]
|
||||
<h4 align="center">
|
||||
<br>
|
||||
<br>
|
||||
<a href="http://fisherman.sh"><img
|
||||
alt="fisherman"
|
||||
width=800px
|
||||
src="https://rawgit.com/fisherman/logo/master/fisherman-black-white.svg"></a>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</h4>
|
||||
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
[![fisherman Version][version-badge]][version-link]
|
||||
[![Slack Room][slack-badge]][slack-link]
|
||||
|
||||
## 安装
|
||||
|
||||
```fish
|
||||
curl -sL get.fisherman.sh | fish
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
安装 [fishery][fishery] 插件。
|
||||
|
||||
```
|
||||
fisher i fishtape shark get bobthefish
|
||||
```
|
||||
|
||||
安装 [Oh My Fish][Oh My Fish] 插件。
|
||||
|
||||
```fish
|
||||
fisher i omf/plugin-{percol,jump,fasd}
|
||||
```
|
||||
|
||||
安装本地插件。
|
||||
|
||||
```fish
|
||||
fisher i ./path/to/plugin
|
||||
```
|
||||
|
||||
从不同的 URL 安装插件。
|
||||
|
||||
```fish
|
||||
fisher i https://github.com/some/plugin another/plugin bb:one/more
|
||||
```
|
||||
|
||||
从 [Gist][Gist] 安装插件。
|
||||
|
||||
```fish
|
||||
fisher i gist.github.com/owner/1f40e1c6e0551b2666b2
|
||||
```
|
||||
|
||||
更新所有的插件。
|
||||
|
||||
```
|
||||
fisher u
|
||||
```
|
||||
|
||||
更新指定的插件。
|
||||
|
||||
```
|
||||
fisher u shark get
|
||||
```
|
||||
|
||||
卸载指定的插件。
|
||||
|
||||
```
|
||||
fisher uninstall fishtape debug
|
||||
```
|
||||
|
||||
|
||||
## 显示和搜索
|
||||
|
||||
`fisher list` 命令会显示本地安装的插件。`fisher search` 命令会通过本地索引去查找合适的插件。
|
||||
|
||||
```
|
||||
fisher list
|
||||
debug
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ wipe
|
||||
```
|
||||
|
||||
查找插件。
|
||||
|
||||
```
|
||||
fisher search
|
||||
...
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> superman Powerline prompt based on Superman
|
||||
...
|
||||
```
|
||||
|
||||
使用正则表达式查找插件。
|
||||
|
||||
```
|
||||
fisher search --name~/git-is/
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
```
|
||||
|
||||
使用标签查找插件。
|
||||
|
||||
```
|
||||
fisher search --tag={git,test}
|
||||
...
|
||||
* fishtape TAP producing test runner
|
||||
git-branch-name Get the name of the current Git branch
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
...
|
||||
```
|
||||
|
||||
最前面的符号有以下几种含义:
|
||||
|
||||
* `>` 该插件是用于修改提示符
|
||||
* `*` 该插件已安装
|
||||
* `@` 该插件是一个本地软链接
|
||||
|
||||
|
||||
## 管道
|
||||
|
||||
fisherman 的命令全部支持管道。可以通过管道来连接其他命令,从而实现更复杂的功能。
|
||||
|
||||
更新所有为软链接的插件。
|
||||
|
||||
```fish
|
||||
fisher list --link | fisher update -
|
||||
```
|
||||
|
||||
重新启用被禁用的插件。
|
||||
|
||||
```fish
|
||||
fisher list --disabled | fisher install
|
||||
```
|
||||
|
||||
卸载所有的插件,并从缓存中删除。
|
||||
|
||||
```fish
|
||||
fisher list | fisher uninstall --force
|
||||
```
|
||||
|
||||
## Bundle
|
||||
|
||||
当你安装一个插件时,fisherman 会更新到 *bundle* 文件以便之后跟踪激活了哪些插件。
|
||||
|
||||
* 自定义 bundle 的位置。
|
||||
|
||||
```fish
|
||||
set -g fisher_file ~/.dotfiles/bundle
|
||||
```
|
||||
|
||||
## 扁平的目录结构
|
||||
|
||||
fisherman 会合并所有插件的目录到一个扁平的目录结构。之所以这样做的原因是因为无论安装了多少插件,只用在 shell 启动时加载一次,fisherman 就能拥有不错的性能。
|
||||
|
||||
以下图例展现了一个插件在 Fiserhman 中的目录结构。
|
||||
```
|
||||
$fisher_config
|
||||
├── cache
|
||||
├── completions
|
||||
│ └── my_plugin.fish
|
||||
├── conf.d
|
||||
│ └── my_plugin.fish
|
||||
├── bundle
|
||||
├── functions
|
||||
│ ├── fish_prompt.fish
|
||||
│ ├── fish_right_prompt.fish
|
||||
│ └── my_plugin.fish
|
||||
└── man
|
||||
└── man1
|
||||
└── my_plugin.1
|
||||
```
|
||||
|
||||
## 索引
|
||||
|
||||
索引就是一个用来记录被 fisherman 安装的插件的文本数据库。
|
||||
|
||||
索引记录了每个插件的*名字*, *地址*, *信息*,*标签*以及*作者*。
|
||||
|
||||
```
|
||||
z
|
||||
https://github.com/fishery/z
|
||||
Pure-fish z directory jumping
|
||||
z search cd jump
|
||||
jethrokuan
|
||||
```
|
||||
|
||||
如果你想要提交插件, 你可以向这个 [仓库](https://github.com/fisherman/index) 发起一个 PR
|
||||
```
|
||||
git clone https://github.com/fisherman/index
|
||||
cd index
|
||||
echo "$name\n$url\n$info\n$tags\n$author\n\n" >> index
|
||||
git push origin master
|
||||
```
|
||||
|
||||
## 变量
|
||||
|
||||
* $fisher_home:
|
||||
fisherman 的家目录。如果你按照推荐的方式安装了 fisherman,这个变量应该是 *XDG_DATA_HOME/fisherman* 。
|
||||
|
||||
* $fisher_config:
|
||||
fisherman 的配置目录。这个目录默认应该是你的 *fishfile*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* 等目录所在的位置。它的默认值是 *XDG_CONFIG_HOME/fisherman* 。
|
||||
|
||||
* $fisher_file:
|
||||
bundle 文件的位置
|
||||
|
||||
* $fisher_cache:
|
||||
fisherman 的缓存目录。 所有的插件都会被下载到这个位置。
|
||||
|
||||
* $fisher_alias *command*=*alias* ...:
|
||||
可以使用这个变量去创建 fisherman 的命令别名。
|
||||
|
||||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
|
||||
[version-badge]: https://img.shields.io/badge/latest-v1.4.0-00B9FF.svg?style=flat-square
|
||||
[version-link]: https://github.com/fisherman/fisherman/releases
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
[![Slack][slack-badge]][slack-link]
|
||||
|
||||
[slack-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square
|
||||
# [fisherman] - fish shell plugin manager
|
||||
|
||||
[play]: https://cloud.githubusercontent.com/assets/8317250/14401577/14411b12-fe51-11e5-8d5a-bb054edfc2d4.png
|
||||
[play-link]: http://fisherman.sh/#demo
|
||||
|
||||
[Plugins]: http://fisherman.sh/#search
|
||||
[fish]: https://github.com/fish-shell/fish-shell
|
||||
|
||||
[other]: https://github.com/fisherman/fisherman/wiki/Installing-fisherman#notes
|
||||
[fisherman]: http://fisherman.sh
|
||||
[fish shell]: https://github.com/fish-shell/fish-shell
|
||||
[organization]: https://github.com/fisherman
|
||||
[online]: http://fisherman.sh/#search
|
||||
|
||||
[English]: ../../README.md
|
||||
[Español]: docs/es-ES
|
||||
[日本語]: docs/jp-JA
|
||||
|
|
1895
fisher.fish
Normal file
1895
fisher.fish
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,3 +0,0 @@
|
|||
function __fisher_cache_list
|
||||
command find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||'
|
||||
end
|
|
@ -1,13 +0,0 @@
|
|||
function __fisher_complete -a parent child
|
||||
if test ! -z "$child"
|
||||
set child "__fish_seen_subcommand_from $child"
|
||||
end
|
||||
|
||||
set -l IFS ';'
|
||||
|
||||
__fisher_help_parse | while read -l d l s
|
||||
complete -c $parent -s "$s" -l "$l" -d "$d" -n "$child"
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function __fisher_complete_reset
|
||||
complete -ec fisher
|
||||
source $fisher_home/completions/fisher.fish
|
||||
end
|
|
@ -1,63 +0,0 @@
|
|||
function __fisher_config_color_reset -a path
|
||||
if test ! -f "$path"
|
||||
set -U fish_color_normal normal
|
||||
set -U fish_color_command 005fd7 purple
|
||||
set -U fish_color_param 00afff cyan
|
||||
set -U fish_color_redirection 005fd7
|
||||
set -U fish_color_comment 600
|
||||
set -U fish_color_error red --bold
|
||||
set -U fish_color_escape cyan
|
||||
set -U fish_color_operator cyan
|
||||
set -U fish_color_end green
|
||||
set -U fish_color_quote brown
|
||||
set -U fish_color_autosuggestion 555 yellow
|
||||
set -U fish_color_user green
|
||||
set -U fish_color_valid_path --underline
|
||||
set -U fish_color_cwd green
|
||||
set -U fish_color_cwd_root red
|
||||
set -U fish_color_match cyan
|
||||
set -U fish_color_search_match --background=purple
|
||||
set -U fish_color_selection --background=purple
|
||||
set -U fish_pager_color_prefix cyan
|
||||
set -U fish_pager_color_completion normal
|
||||
set -U fish_pager_color_description 555 yellow
|
||||
set -U fish_pager_color_progress cyan
|
||||
set -U fish_color_history_current cyan
|
||||
set -U fish_color_host normal
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
set -l IFS \n
|
||||
|
||||
read -laz fish_colors < $path
|
||||
|
||||
set fish_colors[25] ""
|
||||
|
||||
set -U fish_color_normal (echo "$fish_colors[1]" | tr " " \n)
|
||||
set -U fish_color_command (echo "$fish_colors[2]" | tr " " \n)
|
||||
set -U fish_color_param (echo "$fish_colors[3]" | tr " " \n)
|
||||
set -U fish_color_redirection (echo "$fish_colors[4]" | tr " " \n)
|
||||
set -U fish_color_comment (echo "$fish_colors[5]" | tr " " \n)
|
||||
set -U fish_color_error (echo "$fish_colors[6]" | tr " " \n)
|
||||
set -U fish_color_escape (echo "$fish_colors[7]" | tr " " \n)
|
||||
set -U fish_color_operator (echo "$fish_colors[8]" | tr " " \n)
|
||||
set -U fish_color_end (echo "$fish_colors[9]" | tr " " \n)
|
||||
set -U fish_color_quote (echo "$fish_colors[10]" | tr " " \n)
|
||||
set -U fish_color_autosuggestion (echo "$fish_colors[11]" | tr " " \n)
|
||||
set -U fish_color_user (echo "$fish_colors[12]" | tr " " \n)
|
||||
set -U fish_color_valid_path (echo "$fish_colors[13]" | tr " " \n)
|
||||
set -U fish_color_cwd (echo "$fish_colors[14]" | tr " " \n)
|
||||
set -U fish_color_cwd_root (echo "$fish_colors[15]" | tr " " \n)
|
||||
set -U fish_color_match (echo "$fish_colors[16]" | tr " " \n)
|
||||
set -U fish_color_search_match (echo "$fish_colors[17]" | tr " " \n)
|
||||
set -U fish_color_selection (echo "$fish_colors[18]" | tr " " \n)
|
||||
set -U fish_pager_color_prefix (echo "$fish_colors[19]" | tr " " \n)
|
||||
set -U fish_pager_color_completion (echo "$fish_colors[20]" | tr " " \n)
|
||||
set -U fish_pager_color_description (echo "$fish_colors[21]" | tr " " \n)
|
||||
set -U fish_pager_color_progress (echo "$fish_colors[22]" | tr " " \n)
|
||||
set -U fish_color_history_current (echo "$fish_colors[23]" | tr " " \n)
|
||||
set -U fish_color_host (echo "$fish_colors[24]" | tr " " \n)
|
||||
|
||||
rm -f $path
|
||||
end
|
|
@ -1,31 +0,0 @@
|
|||
function __fisher_config_color_save -a path
|
||||
if test -f "$path"
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" \
|
||||
"$fish_color_normal" \
|
||||
"$fish_color_command" \
|
||||
"$fish_color_param" \
|
||||
"$fish_color_redirection" \
|
||||
"$fish_color_comment" \
|
||||
"$fish_color_error" \
|
||||
"$fish_color_escape" \
|
||||
"$fish_color_operator" \
|
||||
"$fish_color_end" \
|
||||
"$fish_color_quote" \
|
||||
"$fish_color_autosuggestion" \
|
||||
"$fish_color_user" \
|
||||
"$fish_color_valid_path" \
|
||||
"$fish_color_cwd" \
|
||||
"$fish_color_cwd_root" \
|
||||
"$fish_color_match" \
|
||||
"$fish_color_search_match" \
|
||||
"$fish_color_selection" \
|
||||
"$fish_pager_color_prefix" \
|
||||
"$fish_pager_color_completion" \
|
||||
"$fish_pager_color_description" \
|
||||
"$fish_pager_color_progress" \
|
||||
"$fish_color_history_current" \
|
||||
"$fish_color_host" > "$path"
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
function __fisher_file
|
||||
awk -v FS=\t '
|
||||
/^[ \t]*package / {
|
||||
gsub("^[ \t]*package ", "https://github.com/oh-my-fish/plugin-")
|
||||
printf("%s\n", $0)
|
||||
next
|
||||
}
|
||||
|
||||
/@http/ {
|
||||
gsub("@.*$", "", $1)
|
||||
}
|
||||
|
||||
!/^[ \t]*(#.*)*$/ {
|
||||
gsub("^[@*>]?[ \t]*?|#.*", "")
|
||||
|
||||
if (! seen[$1]++) {
|
||||
printf("%s\n", $1)
|
||||
}
|
||||
}
|
||||
'
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function __fisher_file_contains -a plugin
|
||||
set -e argv[1]
|
||||
grep -E "^(package *|plugin *)?$plugin.*\$" $argv
|
||||
end
|
|
@ -1,13 +0,0 @@
|
|||
function __fisher_file_remove -a plugin file
|
||||
if __fisher_file_contains $plugin < $file
|
||||
set pattern (printf "%s\n" $plugin | __fisher_string_escape)
|
||||
|
||||
if test ! -z "$pattern"
|
||||
set pattern "/^$pattern\$/d"
|
||||
end
|
||||
|
||||
sed -E "$pattern" < $file > $file.tmp
|
||||
|
||||
command mv $file.tmp $file
|
||||
end
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
function -S __fisher_gist_to_name -a url
|
||||
set -l gist_id (printf "%s\n" "$url" | sed 's|.*/||')
|
||||
|
||||
set -l name (
|
||||
spin "curl -Ss https://api.github.com/gists/$gist_id" -f " $color@$color_normal\r" | awk '
|
||||
|
||||
/"files": / { files++ }
|
||||
|
||||
/"[^ ]+.fish": / && files {
|
||||
gsub("^ *\"|\.fish.*", "")
|
||||
print
|
||||
}
|
||||
'
|
||||
)
|
||||
|
||||
if test -z "$name"
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" $name
|
||||
end
|
|
@ -1,20 +0,0 @@
|
|||
function __fisher_help_commands
|
||||
for i in (functions -a | grep -E '^fisher_[^_]+$')
|
||||
functions $i | awk '
|
||||
|
||||
/^$/ { next } {
|
||||
printf("%s;", substr($2, 8))
|
||||
|
||||
gsub("\'", "")
|
||||
|
||||
for (i = 4; i <= NF && $i !~ /^--.*/; i++) {
|
||||
printf("%s ", $i)
|
||||
}
|
||||
|
||||
print ""
|
||||
exit
|
||||
}
|
||||
|
||||
'
|
||||
end
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_help_parse
|
||||
sed -nE 's/^ *(-(.))?,? *--([^ =[]+) *(.*)$/\4;\3;\2/p'
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
function __fisher_help_usage -a value
|
||||
if test -z "$value"
|
||||
set -e value
|
||||
sed -E 's/^ *([^ ]+).*/\1/' | while read -l command
|
||||
if functions -q fisher_$command
|
||||
set value $command $value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for command in $value
|
||||
fisher $command -h
|
||||
end
|
||||
end
|
|
@ -1,29 +0,0 @@
|
|||
function __fisher_index_update -a timeout
|
||||
if test -z "$timeout"
|
||||
set timeout 5
|
||||
|
||||
if set -q fisher_timeout
|
||||
set timeout "0$fisher_timeout"
|
||||
end
|
||||
end
|
||||
|
||||
set -l url $fisher_index
|
||||
|
||||
if test ! -d $fisher_cache
|
||||
mkdir -p $fisher_cache
|
||||
end
|
||||
|
||||
set -l index $fisher_cache/.index.tmp
|
||||
|
||||
if test -z "$url"
|
||||
# force the server to return the latest copy of the index using a fake query string
|
||||
set url https://raw.githubusercontent.com/fisherman/index/master/index\?(date +%s)
|
||||
end
|
||||
|
||||
if not curl --max-time $timeout -sS "$url" > $index
|
||||
command rm -f $index
|
||||
return 1
|
||||
end
|
||||
|
||||
command mv -f $index $fisher_cache/.index
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_key_bindings
|
||||
source $fisher_binds ^ /dev/null
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_key_bindings_delete -a plugin
|
||||
sed "/##$plugin##/,/##$plugin##/d"
|
||||
end
|
|
@ -1,12 +0,0 @@
|
|||
function __fisher_key_bindings_disable -a plugin user_key_bindings
|
||||
fish_indent < $fisher_binds | __fisher_key_bindings_undo $plugin | source ^ /dev/null
|
||||
|
||||
__fisher_key_bindings_delete $plugin > $fisher_binds.tmp < $fisher_binds
|
||||
|
||||
command mv -f $fisher_binds.tmp $fisher_binds
|
||||
|
||||
if test ! -s $fisher_binds
|
||||
sed -i.tmp '/__fisher_key_bindings/d' $user_key_bindings
|
||||
command rm -f $user_key_bindings.tmp
|
||||
end
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
function __fisher_key_bindings_enable -a plugin user_key_bindings
|
||||
__fisher_key_bindings_update $plugin >> $fisher_binds
|
||||
|
||||
if test ! -s $user_key_bindings
|
||||
command mkdir -p (dirname $user_key_bindings)
|
||||
|
||||
printf "%s\n" \
|
||||
"function fish_user_key_bindings" \
|
||||
" __fisher_key_bindings" \
|
||||
"end" > $user_key_bindings
|
||||
|
||||
source $user_key_bindings
|
||||
end
|
||||
|
||||
debug "binds %s" "$user_key_bindings"
|
||||
|
||||
functions fish_user_key_bindings \
|
||||
| __fisher_key_bindings_update_user > $user_key_bindings
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
function __fisher_key_bindings_reset
|
||||
if functions -q fish_user_key_bindings
|
||||
source (__fisher_xdg --config)/fish/functions/fish_user_key_bindings.fish ^ /dev/null
|
||||
fish_user_key_bindings
|
||||
end
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_key_bindings_undo -a plugin
|
||||
sed -n "/##$plugin##/,/##$plugin##/{s/^ *bind /bind -e /p;};"
|
||||
end
|
|
@ -1,28 +0,0 @@
|
|||
function __fisher_key_bindings_update -a name
|
||||
fish_indent | awk \
|
||||
-v name="$name" \
|
||||
-v pattern="^function (fish_user_)?key_bindings\$" '
|
||||
|
||||
function banner() {
|
||||
print "##" name "##"
|
||||
}
|
||||
|
||||
BEGIN { banner() } END { banner() }
|
||||
|
||||
$0 ~ pattern {
|
||||
end = 1
|
||||
next
|
||||
}
|
||||
|
||||
/^end$/ && end {
|
||||
end = 0
|
||||
next
|
||||
}
|
||||
|
||||
!/^ *(#.*)*$/ {
|
||||
gsub("#.*", "")
|
||||
|
||||
printf("%s\n", $0)
|
||||
}
|
||||
'
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
function __fisher_key_bindings_update_user
|
||||
awk -v src=__fisher_key_bindings '
|
||||
NR == 2 {
|
||||
printf("%s\n", src)
|
||||
}
|
||||
|
||||
$0 !~ "^[ \t]*" src { print }
|
||||
|
||||
' | fish_indent
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_list
|
||||
__fisher_file | __fisher_name
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
function __fisher_name
|
||||
sed -E '
|
||||
s|.*/(.*)|\1|
|
||||
s/(plugin|omf-theme|theme|pkg|omf|fish|fisher|fisherman)-//g
|
||||
'
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
function __fisher_path_from_plugin -a plugin
|
||||
switch "$plugin"
|
||||
case /\*
|
||||
__fisher_plugin_from_path $plugin
|
||||
|
||||
case \*/\*
|
||||
__fisher_path_from_url $plugin
|
||||
|
||||
case \*
|
||||
if test ! -d "$fisher_cache/$plugin"
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" $fisher_cache/$plugin
|
||||
end
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
function __fisher_path_from_url -a url
|
||||
for file in $fisher_cache/*
|
||||
pushd $file
|
||||
|
||||
switch "$url"
|
||||
case (git ls-remote --get-url)
|
||||
printf "%s\n" $file
|
||||
popd
|
||||
return
|
||||
end
|
||||
|
||||
popd
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
function __fisher_path_is_prompt -a path
|
||||
test \
|
||||
-e $path/fish_prompt.fish -o -e $path/fish_right_prompt.fish -o \
|
||||
-e $path/functions/fish_prompt.fish -o -e $path/functions/fish_right_prompt.fish
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
function __fisher_path_update -a path
|
||||
pushd $path
|
||||
|
||||
git fetch --quiet origin master ^ /dev/null
|
||||
|
||||
set -l commits (
|
||||
git rev-list --left-right --count "master..FETCH_HEAD" ^ /dev/null | cut -d\t -f2)
|
||||
|
||||
git reset --quiet --hard FETCH_HEAD ^ /dev/null
|
||||
git clean -qdfx
|
||||
|
||||
popd
|
||||
|
||||
if test -z "$commits" -o "$commits" -eq 0
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" "$commits"
|
||||
end
|
|
@ -1,7 +0,0 @@
|
|||
function __fisher_plugin_can_enable -a name path
|
||||
if not __fisher_path_is_prompt $path
|
||||
return 0
|
||||
end
|
||||
|
||||
test "$name" = "$fisher_prompt"
|
||||
end
|
|
@ -1,41 +0,0 @@
|
|||
function __fisher_plugin_disable -a plugin path option
|
||||
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
|
||||
switch "$class"
|
||||
case --bind
|
||||
debug "unbind %s" $plugin
|
||||
|
||||
__fisher_key_bindings_disable $plugin (__fisher_xdg --config
|
||||
)/fish/functions/fish_user_key_bindings.fish
|
||||
|
||||
case --uninstall
|
||||
__fisher_plugin_uninstall_handler $plugin $source "$option"
|
||||
|
||||
case \*
|
||||
__fisher_plugin_unlink $fisher_config/$target $name
|
||||
|
||||
if test "$name" = set_color_custom
|
||||
__fisher_config_color_reset "$fisher_config/fish_colors"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if __fisher_path_is_prompt $path
|
||||
__fisher_prompt_reset
|
||||
end
|
||||
|
||||
if test -s $fisher_file
|
||||
set -l key
|
||||
|
||||
if not set key (fisher_search --name=$plugin --name --index=$fisher_cache/.index)
|
||||
set key (__fisher_url_from_path $path)
|
||||
end
|
||||
|
||||
debug "fishfile remove %s start" "$key"
|
||||
|
||||
if set key (__fisher_file_remove "$key" "$fisher_file")
|
||||
debug "fishfile remove %s ok" "$key"
|
||||
else
|
||||
debug "fishfile remove %s fail" "$key"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,60 +0,0 @@
|
|||
function __fisher_plugin_enable -a plugin path
|
||||
debug "enable %s" "$plugin"
|
||||
|
||||
if __fisher_path_is_prompt $path
|
||||
if test ! -z "$fisher_prompt"
|
||||
debug "disable prompt %s" $fisher_prompt
|
||||
__fisher_plugin_disable "$fisher_prompt" "$fisher_cache/$fisher_prompt"
|
||||
end
|
||||
|
||||
set -U fisher_prompt $plugin
|
||||
end
|
||||
|
||||
set -l link -sfF
|
||||
|
||||
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
|
||||
switch "$class"
|
||||
case --bind
|
||||
debug "bind %s" $source
|
||||
|
||||
__fisher_key_bindings_enable $plugin (__fisher_xdg --config
|
||||
)/fish/functions/fish_user_key_bindings.fish < $source
|
||||
|
||||
case --uninstall
|
||||
case \*
|
||||
if test "$class" = --man
|
||||
command mkdir -p (dirname $fisher_config/$target)
|
||||
end
|
||||
|
||||
__fisher_plugin_link $link $source $fisher_config/$target
|
||||
|
||||
if test "$class" = --source
|
||||
debug "source %s" "$fisher_config/$target"
|
||||
__fisher_plugin_source $plugin $fisher_config/$target
|
||||
|
||||
if test "$name" = set_color_custom
|
||||
debug "color save"
|
||||
__fisher_config_color_save "$fisher_config/fish_colors"
|
||||
set_color_custom
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
set -l item (
|
||||
if not fisher_search --name=$plugin --name --index=$fisher_cache/.index
|
||||
__fisher_url_from_path $path
|
||||
end
|
||||
)
|
||||
|
||||
if test -s $fisher_file
|
||||
if __fisher_file_contains "$item" --quiet $fisher_file
|
||||
debug "file skip %s" "$item"
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
debug "file add %s" "$item"
|
||||
|
||||
printf "%s\n" $item >> $fisher_file
|
||||
end
|
|
@ -1,136 +0,0 @@
|
|||
function -S __fisher_plugin_fetch
|
||||
set -l plugins
|
||||
set -l fetched
|
||||
|
||||
for item in $argv
|
||||
if not set item (__fisher_plugin_validate "$item")
|
||||
printf "fisher: '%s' is not a valid plugin\n" "$item" > $stderr
|
||||
debug "validate fail %s" "$item"
|
||||
continue
|
||||
end
|
||||
|
||||
debug "validate ok %s" "$item"
|
||||
|
||||
if contains -- "$item" $enabled
|
||||
if test -z "$option"
|
||||
set skipped $skipped "$item"
|
||||
debug "skip %s" "$item"
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
switch "$item"
|
||||
case \*/\*
|
||||
set plugins $plugins "$item"
|
||||
debug "url or path %s" $item
|
||||
|
||||
case \*
|
||||
if test -d "$fisher_cache/$item"
|
||||
set -l url (__fisher_url_from_path "$fisher_cache/$item")
|
||||
|
||||
if test ! -z "$url"
|
||||
set plugins $plugins "$url"
|
||||
end
|
||||
|
||||
debug "cache %s" "$item"
|
||||
|
||||
else
|
||||
if test ! -s $fisher_cache/.index
|
||||
if spin "__fisher_index_update" --error=/dev/null > /dev/null
|
||||
debug "update index ok"
|
||||
else
|
||||
debug "update index fail"
|
||||
end
|
||||
end
|
||||
|
||||
if set -l url (fisher_search --url --name="$item" --index=$fisher_cache/.index)
|
||||
set plugins $plugins "$url"
|
||||
debug "name %s" $item
|
||||
|
||||
else
|
||||
printf "fisher: I couldn't find '%s' in the index\n" $item > $stderr
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for plugin in $plugins
|
||||
set -l name (echo $plugin | __fisher_name)
|
||||
set -l path $fisher_cache/$name
|
||||
|
||||
switch "$plugin"
|
||||
case {https://,}gist.github.com\*
|
||||
debug "gist %s" $item
|
||||
|
||||
if not set name (__fisher_gist_to_name $plugin)
|
||||
printf "fisher: I could not find your gist\n" > $stderr
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
printf "%s\n" "$name"
|
||||
debug "plugin %s" "$name"
|
||||
|
||||
if test ! -e "$path"
|
||||
if test -L "$path"
|
||||
set -l realpath (command readlink "$path")
|
||||
if __fisher_file_remove "$realpath" "$fisher_file"
|
||||
debug "Remove broken plugin %s(%s) ok" "$name" "$realpath"
|
||||
else
|
||||
debug "Remove broken plugin %s(%s) fail" "$name" "$realpath"
|
||||
end
|
||||
end
|
||||
|
||||
if not set -q __fisher_fetch_status
|
||||
set -g __fisher_fetch_status
|
||||
printf "Installing plugin/s\n" > $stderr
|
||||
|
||||
else if test "$__fisher_fetch_status" = "deep"
|
||||
printf "Installing dependencies\n" > $stderr
|
||||
set -g __fisher_fetch_status done
|
||||
end
|
||||
|
||||
set fetched $fetched "$path"
|
||||
|
||||
if test -d "$plugin"
|
||||
debug "link %s" "$plugin"
|
||||
command ln -sfF $plugin $path
|
||||
|
||||
else
|
||||
debug "clone %s" "$plugin"
|
||||
fish -ic "
|
||||
spin '
|
||||
if __fisher_url_clone $plugin $path
|
||||
printf \" %-20s\n\" \"$name\"
|
||||
end
|
||||
' > $stderr
|
||||
" &
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if test ! -z "$plugins"
|
||||
while true
|
||||
set -l has_jobs (jobs)
|
||||
if test -z "$has_jobs"
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
switch "$__fisher_fetch_status"
|
||||
case done deep
|
||||
case \*
|
||||
set __fisher_fetch_status deep
|
||||
end
|
||||
|
||||
for path in $fetched
|
||||
for file in $path/{fishfile,bundle}
|
||||
if test -s $file
|
||||
__fisher_plugin_fetch (__fisher_file < $file)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
set -e __fisher_fetch_status
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
function __fisher_plugin_from_path -a path
|
||||
for plugin in $fisher_cache/*
|
||||
switch "$path"
|
||||
case (readlink $plugin)
|
||||
printf "%s\n" $plugin
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function __fisher_plugin_link -a options source target
|
||||
debug "link %s" $target
|
||||
command ln $options $source $target
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_plugin_source -a plugin file
|
||||
source "$file" ^ /dev/null
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
function __fisher_plugin_uninstall_handler -a plugin file option
|
||||
set -l path (dirname $file)
|
||||
|
||||
if source $file $path "$option"
|
||||
emit uninstall_$plugin $path "$option"
|
||||
functions -e uninstall_$plugin
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
function __fisher_plugin_unlink -a file name
|
||||
debug "unlink %s" $file
|
||||
command rm -f $file
|
||||
|
||||
if test ! -z "$name"
|
||||
debug "erase %s" $name
|
||||
functions -e $name
|
||||
end
|
||||
end
|
|
@ -1,56 +0,0 @@
|
|||
function __fisher_plugin_validate -a plugin
|
||||
if test -z "$plugin"
|
||||
return 1
|
||||
end
|
||||
|
||||
if set -q argv[2]
|
||||
printf "%s\n" "$argv"
|
||||
return 1
|
||||
end
|
||||
|
||||
switch "$plugin"
|
||||
case ..\*
|
||||
printf "%s\n" "../"
|
||||
return 1
|
||||
|
||||
case . ./\* /\*
|
||||
if test ! -e "$plugin"
|
||||
printf "%s\n" $plugin
|
||||
return 1
|
||||
end
|
||||
|
||||
set plugin (
|
||||
switch "$plugin"
|
||||
case /\*
|
||||
printf "%s\n" $plugin
|
||||
|
||||
case \*
|
||||
printf "$PWD/%s/%s" (dirname "$plugin") (basename "$plugin")
|
||||
|
||||
end | sed -E 's|[./]*$||; s|/([\./])/+|/|g'
|
||||
)
|
||||
|
||||
printf "%s\n" $plugin
|
||||
|
||||
__fisher_plugin_validate (basename $plugin) > /dev/null
|
||||
|
||||
case \*
|
||||
set -l id "[A-Za-z0-9._-]"
|
||||
|
||||
if not printf "%s\n" "$plugin" | grep -qE "^(($id+)[:/]*)*\$"
|
||||
printf "%s\n" "$plugin"
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" "$plugin" | sed -E "
|
||||
s|^gh[:/]+|https://github.com/|
|
||||
s|^gl[:/]+|https://gitlab.com/|
|
||||
s|^bb[:/]+|https://bitbucket.org/|
|
||||
s|^omf[:/]+|https://github.com/oh-my-fish/|
|
||||
s|^($id+)/($id+)\$|https://github.com/\1/\2|
|
||||
s|^(gist\.github\.com.*)|https://\1|
|
||||
s|^http(s?)[:/]*|http\1://|
|
||||
s|https://github((.com)?/)?|https://github.com/|
|
||||
s|/*(\.git/*)*\$||g" | tr "[A-Z]" "[a-z]"
|
||||
end
|
||||
end
|
|
@ -1,60 +0,0 @@
|
|||
function __fisher_plugin_walk -a plugin path
|
||||
debug "walk %s" "$path"
|
||||
|
||||
for file in $path/{functions/**,*,{conf.d,modules}/*}.{fish,load} $path/completions/*.fish
|
||||
set -l name (basename $file .fish)
|
||||
set -l base $name.fish
|
||||
|
||||
if test "$name" = "getopts"
|
||||
continue # See #191
|
||||
end
|
||||
|
||||
debug "file %s" $file
|
||||
|
||||
switch $file
|
||||
case \*/{fish_user_,}key_bindings.fish
|
||||
printf "%s %s %s\n" --bind $file
|
||||
|
||||
case \*/uninstall.fish
|
||||
printf "%s %s\n" --uninstall $file
|
||||
|
||||
case \*/completions/\*.fish
|
||||
printf "%s %s %s\n" --source $file completions/$base
|
||||
|
||||
case \*/{conf.d,modules}/\?\* \*/\*config.fish \*/{before.,}init.fish \*/$plugin.load
|
||||
switch "$base"
|
||||
case \*$plugin\*
|
||||
case \*
|
||||
set base $plugin.$base
|
||||
end
|
||||
|
||||
switch "$name"
|
||||
case fish_postexec fish_preexec fish_command_not_found
|
||||
case \*
|
||||
set name
|
||||
end
|
||||
|
||||
printf "%s %s %s %s\n" --source $file conf.d/$base $name
|
||||
|
||||
case \*
|
||||
printf "%s %s %s %s\n" --source $file functions/$base $name
|
||||
end
|
||||
end
|
||||
|
||||
for file in $path/{functions/,}*.{py,rb,php,pl,awk,sed}
|
||||
set -l prefix functions
|
||||
set -l target $prefix/(basename $file)
|
||||
|
||||
debug "script %s" $target
|
||||
|
||||
printf "%s %s %s\n" -- $file $target
|
||||
end
|
||||
|
||||
for n in (seq 9)
|
||||
for file in $path/man/man$n/*.$n
|
||||
debug "man$n %s" $file
|
||||
|
||||
printf "%s %s %s\n" --man $file man/man$n/(basename $file)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
function __fisher_prompt_reset
|
||||
set -U fisher_prompt
|
||||
|
||||
set argv $argv (__fisher_xdg --config)/fish $__fish_datadir
|
||||
|
||||
for prompt in $argv/functions/fish_prompt.fish
|
||||
if test -s $prompt
|
||||
debug "reset prompt %s" $prompt
|
||||
|
||||
source $prompt
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
function __fisher_string_escape
|
||||
sed 's|/|\\\/|g'
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function __fisher_url_clone -a url path
|
||||
set -lx GIT_ASKPASS /bin/echo
|
||||
git clone -q --depth 1 $url $path
|
||||
end
|
|
@ -1,27 +0,0 @@
|
|||
function __fisher_url_from_path -a path
|
||||
if test -z "$path"
|
||||
return 1
|
||||
end
|
||||
|
||||
if test -L "$path"
|
||||
readlink $path
|
||||
else
|
||||
pushd $path
|
||||
|
||||
set -l url (git ls-remote --get-url ^ /dev/null)
|
||||
|
||||
popd
|
||||
|
||||
if test -z "$url"
|
||||
return 1
|
||||
end
|
||||
|
||||
switch "$url"
|
||||
case \*gist.github.com\*
|
||||
printf "%s@%s\n" (basename $path) $url
|
||||
|
||||
case \*
|
||||
printf "%s\n" "$url"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,25 +0,0 @@
|
|||
function __fisher_xdg -a dir
|
||||
set -l config $HOME/.config
|
||||
set -l data $HOME/.local/share
|
||||
set -l cache $HOME/.cache
|
||||
|
||||
switch "$dir"
|
||||
case --config{,-home}
|
||||
if set -q XDG_CONFIG_HOME
|
||||
set config $XDG_CONFIG_HOME
|
||||
end
|
||||
printf "%s\n" $config
|
||||
|
||||
case --data{,-home}
|
||||
if set -q XDG_DATA_HOME
|
||||
set data $XDG_DATA_HOME
|
||||
end
|
||||
printf "%s\n" $data
|
||||
|
||||
case --cache{,-home}
|
||||
if set -q XDG_CACHE_HOME
|
||||
set cache $XDG_CACHE_HOME
|
||||
end
|
||||
printf "%s\n" $cache
|
||||
end
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
function debug
|
||||
end
|
|
@ -1,24 +0,0 @@
|
|||
function fish_config -d "Launch fish's web based configuration" -a tab
|
||||
set -l config ~/.config
|
||||
|
||||
if set -q XDG_CONFIG_HOME
|
||||
set config $XDG_CONFIG_HOME
|
||||
end
|
||||
|
||||
set -l file $config/fish/functions/fish_prompt.fish
|
||||
set -l sum_before (cksum $file ^ /dev/null | awk '{ print $1 + $2 }')
|
||||
|
||||
eval $__fish_datadir/tools/web_config/webconfig.py $tab
|
||||
|
||||
if test ! -z "$fisher_prompt"
|
||||
set -l sum_after (cksum $file ^ /dev/null | awk '{ print $1 + $2 }')
|
||||
|
||||
debug "fish_prompt check sum before: %s" $sum_before
|
||||
debug "fish_prompt check sum after: %s" $sum_after
|
||||
|
||||
if test "$sum_before" != "$sum_after"
|
||||
debug "uninstall %s" "$fisher_prompt"
|
||||
fisher_uninstall "$fisher_prompt" -q
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,69 +0,0 @@
|
|||
function fisher -d "fish plugin manager"
|
||||
set -l value
|
||||
set -l option help
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set option command
|
||||
set value $2
|
||||
break
|
||||
|
||||
case h help
|
||||
set option help
|
||||
set value $value $2
|
||||
|
||||
case v version
|
||||
set option version
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
switch "$option"
|
||||
case command
|
||||
set -l IFS =
|
||||
set -l default_alias install=i update=u search=s list=l help=h new=n uninstall=r
|
||||
|
||||
printf "%s\n" $fisher_alias $default_alias | while read -l command alias
|
||||
if test "$value" = "$alias"
|
||||
set value "$command"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not functions -q "fisher_$value"
|
||||
printf "fisher: '%s' is not a valid command\n" "$value" > /dev/stderr
|
||||
fisher --help > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
|
||||
if contains -- --help $argv
|
||||
fisher help $value
|
||||
return
|
||||
end
|
||||
|
||||
set -e argv[1]
|
||||
|
||||
eval "fisher_$value" (printf "%s\n" "'"$argv"'")
|
||||
|
||||
case version
|
||||
sed 's/^/fisher version /' $fisher_home/VERSION
|
||||
|
||||
case help
|
||||
printf "Usage: fisher <command> [<options>] [--help] [--version]\n\n"
|
||||
|
||||
set -l color (set_color -u)
|
||||
set -l color_normal (set_color normal)
|
||||
|
||||
printf "where <command> can be one of:\n"
|
||||
|
||||
__fisher_help_commands | sed "
|
||||
s/^/ /
|
||||
s/;/"\t" /
|
||||
" | column -ts\t
|
||||
end
|
||||
end
|
|
@ -1,46 +0,0 @@
|
|||
function fisher_help -d "Show command help (h)"
|
||||
if not set -q argv[1]
|
||||
man fisher
|
||||
return
|
||||
end
|
||||
|
||||
set -l option
|
||||
set -l value
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set option man
|
||||
set value $2
|
||||
|
||||
case usage
|
||||
set option usage
|
||||
set value $value $2
|
||||
|
||||
case h
|
||||
printf "Usage: fisher help [<keyword>]\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher_help -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
switch "$option"
|
||||
case man
|
||||
set -l value (printf "%s\n" $value | awk '{ print tolower($0) }')
|
||||
|
||||
switch "$value"
|
||||
case me fisher fisherman
|
||||
man fisher
|
||||
|
||||
case \*
|
||||
man fisher-$value
|
||||
end
|
||||
|
||||
case usage
|
||||
__fisher_help_usage $value
|
||||
end
|
||||
end
|
|
@ -1,71 +0,0 @@
|
|||
function fisher_install -d "Install plugins (i)"
|
||||
set -l items
|
||||
set -l option
|
||||
set -l stdout /dev/stdout
|
||||
set -l stderr /dev/stderr
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set items $items $2
|
||||
|
||||
case q quiet
|
||||
set stdout /dev/null
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "Usage: fisher install [<plugins>] [--quiet] [--help]\n\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher_install -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
command mkdir -p $fisher_cache $fisher_config/{functions,completions,conf.d,man}
|
||||
|
||||
set -l time (date +%s)
|
||||
set -l count 0
|
||||
set -l index 1
|
||||
set -l skipped
|
||||
set -l enabled (fisher_list --enabled)
|
||||
|
||||
if test -z "$items"
|
||||
__fisher_file | read -az items
|
||||
end
|
||||
|
||||
set -l plugins (__fisher_plugin_fetch $items | awk '!seen[$0]++')
|
||||
|
||||
for plugin in $plugins
|
||||
set -l path $fisher_cache/$plugin
|
||||
|
||||
if test -d $path
|
||||
__fisher_plugin_enable "$plugin" "$path"
|
||||
|
||||
set count (math $count + 1)
|
||||
end
|
||||
end
|
||||
|
||||
set time (math (date +%s) - $time)
|
||||
|
||||
if test ! -z "$skipped"
|
||||
printf "%s plugin/s skipped (%s)\n" (
|
||||
count $skipped) (printf "%s\n" $skipped | paste -sd ' ' -) > $stdout
|
||||
end
|
||||
|
||||
if test "$count" -le 0
|
||||
printf "No plugins were installed\n" > $stdout
|
||||
return 1
|
||||
end
|
||||
|
||||
__fisher_complete_reset
|
||||
__fisher_key_bindings_reset
|
||||
|
||||
debug "complete and key binds reset"
|
||||
|
||||
printf "%d plugin/s installed (%0.fs)\n" $count $time > $stdout
|
||||
end
|
|
@ -1,58 +0,0 @@
|
|||
function fisher_list -a key -d "List installed plugins (l)"
|
||||
set -l enabled
|
||||
|
||||
if test -f "$fisher_file"
|
||||
set enabled (__fisher_list < $fisher_file)
|
||||
end
|
||||
|
||||
switch "$key"
|
||||
case ""
|
||||
set -l indent
|
||||
set -l links (command find $fisher_cache/* -maxdepth 0 -type l ^ /dev/null | sed 's|.*/||')
|
||||
|
||||
if test ! -z "$fisher_prompt"
|
||||
set indent " "
|
||||
end
|
||||
|
||||
for plugin in $links
|
||||
if contains -- "$plugin" $enabled
|
||||
set indent " "
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
for plugin in $enabled
|
||||
if contains -- "$plugin" $links
|
||||
printf "%s %s\n" "@" $plugin
|
||||
|
||||
else if test $plugin = "$fisher_prompt"
|
||||
printf "%s %s\n" ">" $plugin
|
||||
|
||||
else
|
||||
printf "$indent$indent%s\n" $plugin
|
||||
end
|
||||
end
|
||||
|
||||
case --enabled
|
||||
if test ! -z "$enabled"
|
||||
printf "%s\n" $enabled
|
||||
end
|
||||
|
||||
case --disabled
|
||||
for name in (__fisher_cache_list)
|
||||
if not contains -- $name $enabled
|
||||
printf "%s\n" $name
|
||||
end
|
||||
end
|
||||
|
||||
case -
|
||||
__fisher_list
|
||||
|
||||
case -h
|
||||
printf "Usage: fisher list [--enabled] [--disabled] [--help]\n\n"
|
||||
printf " --enabled List plugins that are enabled\n"
|
||||
printf " --disabled List plugins that are disabled\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
end
|
||||
end
|
|
@ -1,279 +0,0 @@
|
|||
function fisher_search -d "Search plugin index (s)"
|
||||
set -l fields
|
||||
set -l query
|
||||
set -l index
|
||||
set -l join "||"
|
||||
set -l format
|
||||
set -l option
|
||||
set -l stdout /dev/stdout
|
||||
set -l color (set_color $fish_color_quote)
|
||||
set -l color_normal (set_color normal)
|
||||
|
||||
getopts $argv | while read -l 1 2 3
|
||||
switch "$1"
|
||||
case _
|
||||
switch "$2"
|
||||
case \*/\*
|
||||
set -l url (__fisher_plugin_validate $2)
|
||||
|
||||
if test ! -z "$url"
|
||||
set 2 $url
|
||||
end
|
||||
|
||||
set query $query "url==\"$2\"" $join
|
||||
|
||||
case \*
|
||||
set query $query "name==\"$2\"" $join
|
||||
end
|
||||
|
||||
case name url info author
|
||||
if test -z "$2"
|
||||
set fields $fields $1 ,
|
||||
else
|
||||
switch "$2"
|
||||
case ~\*
|
||||
set query $query "$1$3$2" $join
|
||||
|
||||
case \*
|
||||
if test -z "$3"
|
||||
set 3 =
|
||||
end
|
||||
set query $query "$1$3=\"$2\"" $join
|
||||
end
|
||||
end
|
||||
|
||||
case tag{,s}
|
||||
if test -z "$2"
|
||||
set fields $fields "tags(0)" ,
|
||||
else
|
||||
set query $query "$3 tags(\"$2\")" $join
|
||||
end
|
||||
|
||||
case long longline
|
||||
set format long
|
||||
|
||||
case full
|
||||
set format full
|
||||
|
||||
case a and
|
||||
set join "&&"
|
||||
|
||||
case o or
|
||||
set join "||"
|
||||
|
||||
case C no-color
|
||||
set color
|
||||
set color_normal
|
||||
set option no-color
|
||||
|
||||
case query
|
||||
set query $query $2
|
||||
|
||||
case index
|
||||
set index $2
|
||||
|
||||
case q quiet
|
||||
set stdout /dev/null
|
||||
|
||||
case h
|
||||
printf "Usage: fisher search [<plugins>] [--long] [--full] [--no-color]\n"
|
||||
printf " [--quiet] [--help]\n\n"
|
||||
|
||||
printf " --long Display results in long format\n"
|
||||
printf " --full Display results in full format\n"
|
||||
printf " -C --no-color Turn off color display\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher_search -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
if test -z "$index"
|
||||
set index $fisher_cache/.index
|
||||
|
||||
set fisher_last_update (math (date +%s) - "0$fisher_last_update")
|
||||
|
||||
if not set -q fisher_update_interval
|
||||
set -g fisher_update_interval 50
|
||||
end
|
||||
|
||||
if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index
|
||||
debug "Update index start"
|
||||
|
||||
if spin "__fisher_index_update" --error=/dev/null > /dev/null
|
||||
debug "Update index ok"
|
||||
__fisher_complete_reset
|
||||
else
|
||||
debug "Update index fail"
|
||||
end
|
||||
end
|
||||
|
||||
set -U fisher_last_update (date +%s)
|
||||
end
|
||||
|
||||
set -e fields[-1]
|
||||
set -e query[-1]
|
||||
|
||||
set -l options -v OFS=';' -v compact=1
|
||||
|
||||
if test -z "$fields[1]"
|
||||
set options -v OFS='\n'
|
||||
|
||||
if test -z "$format"
|
||||
if test -z "$fisher_search_format"
|
||||
set format default
|
||||
else
|
||||
set format "$fisher_search_format"
|
||||
end
|
||||
end
|
||||
|
||||
set -l color_name (set_color $fish_color_quote)
|
||||
set -l color_url (set_color $fish_color_end -u)
|
||||
set -l color_tag (set_color $fish_color_command)
|
||||
set -l color_weak (set_color white -o)
|
||||
set -l color_author (set_color -u)
|
||||
set -l color_normal (set_color $fish_color_normal)
|
||||
|
||||
if contains -- no-color $option
|
||||
set color_name
|
||||
set color_url
|
||||
set color_tag
|
||||
set color_weak
|
||||
set color_author
|
||||
set color_normal
|
||||
end
|
||||
|
||||
set legend
|
||||
set local (fisher_list | awk '
|
||||
!/^@/ {
|
||||
if (append) {
|
||||
printf("|")
|
||||
}
|
||||
|
||||
printf("%s", substr($0, 3))
|
||||
|
||||
append++
|
||||
}
|
||||
'
|
||||
)
|
||||
|
||||
if test ! -z "$local"
|
||||
set legend " "
|
||||
end
|
||||
|
||||
set fields '
|
||||
legend="*"
|
||||
len = length($3)
|
||||
|
||||
if ($1 == "'"$fisher_prompt"'") {
|
||||
legend = ">"
|
||||
}
|
||||
|
||||
if ("'"$local"'" && $1~/'"$local"'/) {
|
||||
'
|
||||
|
||||
switch "$format"
|
||||
case default
|
||||
set fields $fields '
|
||||
printf("%s '"$color_weak"'%-22s'"$color_normal"' %s\n", legend, $1, normalize($3, len + 28))
|
||||
} else {
|
||||
printf("'"$legend$color_name"'%-22s'"$color_normal"' %s\n", $1, normalize($3, len + 28))
|
||||
}
|
||||
'
|
||||
set options $options -v compact=1
|
||||
|
||||
case long
|
||||
set fields $fields '
|
||||
printf("%-40s %s '"$color_weak"'%-22s'"$color_normal"' %s\n", humanize_url($2), legend, $1, normalize($3, len + 70))
|
||||
} else {
|
||||
printf("'"$color_tag"'%-40s'"$color_normal"' '"$legend$color_name"'%-22s'"$color_normal"' %s\n", humanize_url($2), $1, normalize($3, len + 70))
|
||||
}
|
||||
'
|
||||
set options $options -v compact=1
|
||||
|
||||
case full
|
||||
set fields $fields '
|
||||
printf("'"$color_weak"'%s %s by %s\n%s'"$color_normal"'\n%s\n", legend, $1, $5, $3, humanize_url($2))
|
||||
} else {
|
||||
printf("'"$color_name"'%s'"$color_normal"' by '"$color_author"'%s'"$color_normal"'\n%s\n'"$color_url"'%s'"$color_normal"'\n", $1, $5, $3, humanize_url($2))
|
||||
}
|
||||
'
|
||||
end
|
||||
else
|
||||
if test "$fields" = author
|
||||
set options $options -v unique=1
|
||||
end
|
||||
|
||||
set fields print $fields
|
||||
end
|
||||
|
||||
set -l cols (tput cols)
|
||||
|
||||
awk -v FS='\n' -v RS='' $options "
|
||||
|
||||
function normalize(s, len) {
|
||||
x = len - $cols
|
||||
if (len >= $cols) {
|
||||
return substr(s, 1, length(s) - x)\"...\"
|
||||
} else {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
function humanize_url(url) {
|
||||
gsub(\"(https?://)?(www.)?|/\$\", \"\", url)
|
||||
return url
|
||||
}
|
||||
|
||||
function tags(tag, _list) {
|
||||
if (!tag) {
|
||||
for (i in tag_list) {
|
||||
if (!seen[tag_list[i]]++) {
|
||||
_list = tag_list[i] \"\n\" _list
|
||||
}
|
||||
}
|
||||
return substr(_list, 1, length(_list) - 1)
|
||||
}
|
||||
for (i in tag_list) {
|
||||
if (tag == tag_list[i]) {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
{
|
||||
delete tag_list
|
||||
|
||||
if (\$4) {
|
||||
split(\$4, tag_list, \" \")
|
||||
}
|
||||
|
||||
name = \$1
|
||||
url = \$2
|
||||
info = \$3
|
||||
author = \$5
|
||||
}
|
||||
|
||||
$query {
|
||||
if (has_records && !compact) {
|
||||
print \"\"
|
||||
}
|
||||
|
||||
if (!unique_author[\$5] || !unique) {
|
||||
unique_author[\$5] = 1
|
||||
$fields
|
||||
}
|
||||
|
||||
has_records = 1
|
||||
}
|
||||
|
||||
END { exit !has_records }
|
||||
|
||||
" $index > $stdout ^ /dev/null
|
||||
end
|
|
@ -1,112 +0,0 @@
|
|||
function fisher_uninstall -d "Uninstall plugins (r)"
|
||||
set -l plugins
|
||||
set -l option
|
||||
set -l stdout /dev/stdout
|
||||
set -l stderr /dev/stderr
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set plugins $plugins $2
|
||||
|
||||
case f force
|
||||
set option force
|
||||
|
||||
if test ! -z "$2"
|
||||
set plugins $plugins $2
|
||||
end
|
||||
|
||||
case q quiet
|
||||
set stdout /dev/null
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "Usage: fisher uninstall [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
printf " -f --force Delete copy from the cache\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher_uninstall -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
set -l count 0
|
||||
set -l skipped
|
||||
set -l time (date +%s)
|
||||
|
||||
set -l IFS \t
|
||||
|
||||
printf "Uninstalling\n" > $stderr
|
||||
|
||||
if set -q plugins[1]
|
||||
printf "%s\n" $plugins
|
||||
else
|
||||
__fisher_file
|
||||
|
||||
end | while read -l item path
|
||||
debug "validate %s" $item
|
||||
|
||||
if not set item (__fisher_plugin_validate $item)
|
||||
debug "validate fail %s" $item
|
||||
printf "fisher: '%s' is not a valid plugin\n" $item > $stderr
|
||||
continue
|
||||
end
|
||||
|
||||
debug "validate ok %s" $item
|
||||
|
||||
if not set path (__fisher_path_from_plugin $item)
|
||||
printf "fisher: I could not find '%s'\n" $item > $stderr
|
||||
continue
|
||||
end
|
||||
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
if not contains -- $name (fisher_list --enabled)
|
||||
if test -z "$option"
|
||||
debug "skip %s" "$name"
|
||||
|
||||
set skipped $skipped $name
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
printf " %-22s\n" "$name" > $stdout
|
||||
debug "uninstall %s" "$name"
|
||||
|
||||
if __fisher_plugin_can_enable "$name" "$path"
|
||||
__fisher_plugin_disable "$name" "$path" "$option"
|
||||
debug "disable %s[:%s]" "$name" "$option"
|
||||
end
|
||||
|
||||
if test "$option" = force
|
||||
command rm -rf $path
|
||||
debug "remove %s" "$path"
|
||||
end
|
||||
|
||||
set count (math $count + 1)
|
||||
end
|
||||
|
||||
set time (math (date +%s) - $time)
|
||||
|
||||
if test ! -z "$skipped"
|
||||
printf "%s plugin/s skipped (%s)\n" (count $skipped) (
|
||||
printf "%s\n" $skipped | paste -sd ' ' -
|
||||
) > $stderr
|
||||
end
|
||||
|
||||
if test $count -le 0
|
||||
printf "No plugins were uninstalled\n" > $stderr
|
||||
return 1
|
||||
end
|
||||
|
||||
__fisher_complete_reset
|
||||
__fisher_key_bindings_reset
|
||||
|
||||
debug "complete / key bindings reset"
|
||||
|
||||
printf "%d plugin/s uninstalled in %0.fs\n" $count $time > $stderr
|
||||
end
|
|
@ -1,157 +0,0 @@
|
|||
function fisher_update -d "Update plugins (u)"
|
||||
set -l items
|
||||
set -l plugins
|
||||
set -l enabled (fisher_list --enabled)
|
||||
set -l stdout /dev/stdout
|
||||
set -l stderr /dev/stderr
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set items $items $2
|
||||
|
||||
case q quiet
|
||||
set stdout /dev/null
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "Usage: fisher update [<plugins>] [--quiet] [--help]\n\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
fisher_update -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
if set -l index (contains -i -- - $items)
|
||||
set -e items[$index]
|
||||
set -l IFS \t
|
||||
|
||||
__fisher_file | while read -l item
|
||||
set items $items $item
|
||||
end
|
||||
|
||||
else if test -z "$items"
|
||||
set -l time (date +%s)
|
||||
set -l previous_version (cat $fisher_home/VERSION)
|
||||
|
||||
debug "update %s" $fisher_cache/.index
|
||||
debug "update %s" $fisher_home
|
||||
|
||||
if not spin "__fisher_index_update 0" --error=$stderr
|
||||
debug "update index fail"
|
||||
end
|
||||
|
||||
if not spin "__fisher_path_update $fisher_home" --error=$stderr
|
||||
debug "update fisherman fail"
|
||||
|
||||
printf "fisher: I couldn't update Fisherman\n\n" > $stderr
|
||||
return 1
|
||||
end
|
||||
|
||||
debug "update fisherman ok"
|
||||
|
||||
set -l new_version (cat $fisher_home/VERSION)
|
||||
|
||||
if test "$new_version" != "$previous_version"
|
||||
printf "Aye! Fisherman updated from %s to %s (%0.fs)\n" \
|
||||
"$previous_version" "$new_version" (math (date +%s) - $time) > $stderr
|
||||
else
|
||||
printf "Aye! Fisherman is up to date\n" $time > $stderr
|
||||
end
|
||||
|
||||
set items $enabled
|
||||
end
|
||||
|
||||
for item in $items
|
||||
if not contains -- $item $enabled
|
||||
printf "fisher: I couldn't find '%s'\n" $item > $stderr
|
||||
continue
|
||||
end
|
||||
|
||||
if not set item (__fisher_plugin_validate $item)
|
||||
printf "fisher: '%s' is not a valid plugin\n" $item > $stderr
|
||||
debug "validate fail %s" $item
|
||||
continue
|
||||
end
|
||||
|
||||
set -l path (__fisher_path_from_plugin $item)
|
||||
|
||||
if test -z "$path"
|
||||
printf "fisher: I could not find '%s'\n" $item > $stderr
|
||||
continue
|
||||
end
|
||||
|
||||
set plugins $plugins $path
|
||||
debug "validate ok %s" $item
|
||||
end
|
||||
|
||||
set -l time (date +%s)
|
||||
set -l total (count $plugins)
|
||||
set -U fisher_updated_plugins
|
||||
|
||||
if set -q plugins[1]
|
||||
if test "$total" -gt 0
|
||||
printf "Updating %d plugin/s\n" $total > $stderr
|
||||
end
|
||||
|
||||
for path in $plugins
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
if test ! -L $path
|
||||
debug "update %s" "$name"
|
||||
|
||||
fish -ic "
|
||||
spin '
|
||||
if set -l ahead (__fisher_path_update $path)
|
||||
set fisher_updated_plugins \$fisher_updated_plugins $name
|
||||
printf \" %-22s %-10s\n\" \"$name\" \"\$ahead new commit/s\"
|
||||
else
|
||||
printf \" %-22s %-10s\n\" \"$name\" \"Up to date\"
|
||||
end
|
||||
|
||||
'
|
||||
" &
|
||||
end
|
||||
end
|
||||
|
||||
while true
|
||||
set -l has_jobs (jobs)
|
||||
if test -z "$has_jobs"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
for plugin in $fisher_updated_plugins
|
||||
set -l path (__fisher_path_from_plugin "$plugin")
|
||||
|
||||
if __fisher_plugin_can_enable "$plugin" "$path"
|
||||
__fisher_plugin_enable "$plugin" "$path"
|
||||
debug "enable %s" "$plugin"
|
||||
end
|
||||
end
|
||||
|
||||
if test -z "$fisher_updated_plugins"
|
||||
printf "No plugins were updated\n" > $stdout
|
||||
set -e fisher_updated_plugins
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
set time (math (date +%s) - $time)
|
||||
|
||||
if test ! -z "$fisher_updated_plugins" -a "$fisher_updated_plugins" -ne 0
|
||||
printf "%d plugin/s up to date (%0.fs)\n" (count $fisher_updated_plugins) $time > $stdout
|
||||
|
||||
set -e fisher_updated_plugins
|
||||
|
||||
__fisher_complete_reset
|
||||
__fisher_key_bindings_reset
|
||||
|
||||
debug "complete and key binds reset"
|
||||
end
|
||||
end
|
|
@ -1,30 +0,0 @@
|
|||
function getopts -d "Parse command line options"
|
||||
if not set -q argv[1]
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" $argv | sed -E '
|
||||
s/^-([A-Za-z]+)/- \1 /
|
||||
s/^--([A-Za-z0-9_-]+)(!?)=?(.*)/-- \1 \3 \2 /' | awk '
|
||||
|
||||
function out(k,v) { if (!seen[k v]++) print k (v == "" ? "" : " "v) }
|
||||
function pop() { return len <= 0 ? "_" : opt[len--] }
|
||||
|
||||
!/^ *$/ {
|
||||
if (done) out("_" , $1$2$3)
|
||||
else if ($1 == "--" && !$2) done = 1
|
||||
else if ($2 == "" || $1 !~ /^-|^--/ ) out(pop(), $0)
|
||||
else {
|
||||
while (len) out(pop())
|
||||
if ($3) for (i = 4; i <= NF; i++) $3 = $3" "$i
|
||||
if ($1 == "--") if ($3 == "") opt[++len] = $2; else out($2, $3)
|
||||
if ($1 == "-") {
|
||||
if ($2 == "") { print $1; next } else n = split($2, keys, "")
|
||||
if ($3 == "") opt[++len] = keys[n]; else out(keys[n], $3)
|
||||
for (i = 1; i < n; i++) out(keys[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
END { while (len) out(pop()) }
|
||||
'
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function man -d "Format and display the on-line manual pages"
|
||||
set -lx MANPATH {$__fish_datadir,$fisher_config,$fisher_home}/man $MANPATH ""
|
||||
command man $argv
|
||||
end
|
|
@ -1,73 +0,0 @@
|
|||
function spin -d "Background job spinner"
|
||||
set -l format " @\r"
|
||||
set -l commands
|
||||
set -l spinners "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
|
||||
set -l error /dev/stderr
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
case _
|
||||
set commands $commands ";$2"
|
||||
|
||||
case s style
|
||||
set spinners $2
|
||||
|
||||
case f format
|
||||
set format $2
|
||||
|
||||
case error
|
||||
set error $2
|
||||
|
||||
case h help
|
||||
printf "Usage: spin <commands> [--style=<style>] [--format=<string>] \n"
|
||||
printf " [--error=<file>] [--help]\n\n"
|
||||
|
||||
printf " -s --style=<string> Use <string> to slice the spinner characters\n"
|
||||
printf " -f --format=<format> Use <format> to customize the spinner display\n"
|
||||
printf " --error=<file> Write errors to <file>\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
printf "spin: '%s' is not a valid option\n" $1 > /dev/stderr
|
||||
spin -h > /dev/stderr
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
if not set -q commands[1]
|
||||
return 1
|
||||
end
|
||||
|
||||
set spinners (printf "%s\n" "$spinners" | grep -o .)
|
||||
|
||||
set -l tmp (mktemp -t spin.XXX)
|
||||
set -l job_id
|
||||
|
||||
fish -c "$commands" > /dev/stdout ^ $tmp &
|
||||
|
||||
set job_id (jobs -l | cut -d\t -f1)
|
||||
|
||||
while contains -- $job_id (jobs | cut -d\t -f1 ^ /dev/null)
|
||||
if status --is-interactive
|
||||
for i in $spinners
|
||||
printf "$format" | awk -v i=(printf "%s\n" $i | sed 's/=/\\\=/') '
|
||||
{
|
||||
gsub("@", i)
|
||||
printf("%s", $0)
|
||||
}
|
||||
' > /dev/stderr
|
||||
|
||||
sleep 0.05
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if test -s $tmp
|
||||
command cat $tmp > $error
|
||||
command rm -f $tmp
|
||||
return 1
|
||||
end
|
||||
|
||||
command rm -f $tmp
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-HELP" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-help\fR \- Show command help
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher help [\fIcommand\fR] [\-\-help]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher help \fIcommand\fR
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Help displays \fIcommand\fR documentation\.
|
||||
.
|
||||
.P
|
||||
Help is based in man(1) pages\. To supply help with your own plugin or command, create one or more man pages and add them to your project under the corresponding man/man% directory\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
my_plugin
|
||||
|\-\- my_plugin\.fish
|
||||
`\-\- man
|
||||
`\-\- man1
|
||||
`\-\- my_plugin\.1
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
To add documentation to a fisher command, prepend the keyword fisher\- to the man file, e\.g\., fisher\-my\-command\.1\. This will teach Fisherman how to access the man page using \fBfisher help my\-command\fR\.
|
||||
.
|
||||
.P
|
||||
There are utilities that can help you generate man pages from other text formats, such as Markdown\. For example pandoc(1) or ronn(1)\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
man(1), fisher(1)
|
|
@ -1,37 +0,0 @@
|
|||
fisher-help(1) -- Show command help
|
||||
===================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher help [*command*] [--help]<br>
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher help *command*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Help displays *command* documentation.
|
||||
|
||||
Help is based in man(1) pages. To supply help with your own plugin or command, create one or more man pages and add them to your project under the corresponding man/man% directory.
|
||||
|
||||
```
|
||||
my_plugin
|
||||
|-- my_plugin.fish
|
||||
`-- man
|
||||
`-- man1
|
||||
`-- my_plugin.1
|
||||
```
|
||||
|
||||
To add documentation to a fisher command, prepend the keyword fisher- to the man file, e.g., fisher-my-command.1. This will teach Fisherman how to access the man page using `fisher help my-command`.
|
||||
|
||||
There are utilities that can help you generate man pages from other text formats, such as Markdown. For example pandoc(1) or ronn(1).
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
man(1), fisher(1)
|
|
@ -1,157 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-INSTALL" "1" "February 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-install\fR \- Install plugins
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher install [\fIplugins\fR \.\.\.] [\-\-force] [\-\-quiet] [\-\-help]
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher install \fIurl\fR
|
||||
.
|
||||
.br
|
||||
fisher install \fIname\fR
|
||||
.
|
||||
.br
|
||||
fisher install \fIpath\fR
|
||||
.
|
||||
.br
|
||||
fisher install \fIowner/repo\fR
|
||||
.
|
||||
.br
|
||||
fisher install \fIfunction\fR
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Install one or more plugins, by name, URL, path or function name\. If no arguments are given, read the standard input\.
|
||||
.
|
||||
.P
|
||||
In addition, all of the following owner/repo variations are accepted:
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
owner/repo \fIhttps://github\.com/owner/repo\fR
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
github/owner/repo \fIhttps://github\.com/owner/repo\fR
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
gh/owner/repo \fIhttps://github\.com/owner/repo\fR
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Shortcuts to other common Git repository hosting services are also available:
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
bb/owner/repo \fIhttps://bitbucket\.org/owner/repo\fR
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
gl/owner/repo \fIhttps://gitlab\.com/owner/repo\fR
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
omf/owner/repo \fIhttps://github\.com/oh\-my\-fish/repo\fR
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
If a URL is given, the repository is cloned to $fisher_cache the first time and any relevant plugin files are copied to $fisher_config functions, completions, conf\.d and man directories\.
|
||||
.
|
||||
.P
|
||||
If the plugin already exists in $fisher_cache, the files are only copied to $fisher_config\. To update a plugin use fisher update\.
|
||||
.
|
||||
.P
|
||||
If the plugin declares dependencies, these will be installed too\. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues\.
|
||||
.
|
||||
.P
|
||||
If a plugin includes either a fish_prompt\.fish or fish_right_prompt\.fish, both files are first removed from $fisher_config/functions and then the new ones are copied\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-f, \-\-force
|
||||
Reinstall given plugin/s\.
|
||||
.
|
||||
.TP
|
||||
\-q, \-\-quiet
|
||||
Enable quiet mode\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "DIRECTORY TREE"
|
||||
The directory tree in \fImy_plugin\fR
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
my_plugin
|
||||
|\-\- README\.md
|
||||
|\-\- my_plugin\.fish
|
||||
|\-\- functions
|
||||
| `\-\- my_plugin_helper\.fish
|
||||
|\-\- completions
|
||||
| `\-\- my_plugin\.fish
|
||||
|\-\- test
|
||||
| `\-\- my_plugin\.fish
|
||||
`\-\- man
|
||||
`\-\- man1
|
||||
`\-\- my_plugin\.1
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The directory tree in $fisher_config after running fisher install my_plugin:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
$fisher_config
|
||||
|\-\- functions
|
||||
| |\-\- my_plugin\.fish
|
||||
| `\-\- my_plugin_helper\.fish
|
||||
|\-\- completions
|
||||
| `\-\- my_plugin\.fish
|
||||
|\-\- man
|
||||
| `\-\- man1
|
||||
| `\-\- my_plugin\.1
|
||||
`\-\- cache
|
||||
|\-\- my_other_plugin
|
||||
`\-\- my_plugin/\.\.\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "SNIPPETS"
|
||||
Snippets are plugins that run code at the start of the shell\. Snippets must be placed inside a sub directory named conf\.d\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install plugins from multiple sources\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install fishtape superman ~/plugins/my_plugin
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher help uninstall
|
||||
.
|
||||
.br
|
|
@ -1,97 +0,0 @@
|
|||
fisher-install(1) -- Install plugins
|
||||
====================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher install [*plugins* ...] [--quiet] [--help]
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher install *url*<br>
|
||||
fisher install *name*<br>
|
||||
fisher install *path* <br>
|
||||
fisher install *owner/repo*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Install one or more plugins. If no arguments are given, read the standard input.
|
||||
|
||||
In addition, all of the following owner/repo variations are accepted:
|
||||
|
||||
* owner/repo *https://github.com/owner/repo*
|
||||
* github/owner/repo *https://github.com/owner/repo*
|
||||
* gh/owner/repo *https://github.com/owner/repo*
|
||||
|
||||
Shortcuts to other common Git repository hosting services are also available:
|
||||
|
||||
* bb/owner/repo *https://bitbucket.org/owner/repo*
|
||||
* gl/owner/repo *https://gitlab.com/owner/repo*
|
||||
* omf/owner/repo *https://github.com/oh-my-fish/repo*
|
||||
|
||||
If a URL is given, the repository is cloned to $fisher_cache the first time and any relevant plugin files are copied to $fisher_config functions, completions, conf.d and man directories.
|
||||
|
||||
If the plugin already exists in $fisher_cache, the files are only copied to $fisher_config. To update a plugin use fisher update.
|
||||
|
||||
If the plugin declares dependencies, these will be installed too. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues.
|
||||
|
||||
If a plugin includes either a fish_prompt.fish or fish_right_prompt.fish, both files are first removed from $fisher_config/functions and then the new ones are copied.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -q, --quiet:
|
||||
Enable quiet mode.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## DIRECTORY TREE
|
||||
|
||||
The directory tree in *my_plugin*
|
||||
|
||||
```
|
||||
my_plugin
|
||||
|-- README.md
|
||||
|-- my_plugin.fish
|
||||
|-- functions
|
||||
| `-- my_plugin_helper.fish
|
||||
|-- completions
|
||||
| `-- my_plugin.fish
|
||||
|-- test
|
||||
| `-- my_plugin.fish
|
||||
`-- man
|
||||
`-- man1
|
||||
`-- my_plugin.1
|
||||
```
|
||||
|
||||
The directory tree in $fisher_config after running fisher install my_plugin:
|
||||
|
||||
```
|
||||
$fisher_config
|
||||
|-- functions
|
||||
| |-- my_plugin.fish
|
||||
| `-- my_plugin_helper.fish
|
||||
|-- completions
|
||||
| `-- my_plugin.fish
|
||||
|-- man
|
||||
| `-- man1
|
||||
| `-- my_plugin.1
|
||||
`-- cache
|
||||
|-- my_other_plugin
|
||||
`-- my_plugin/...
|
||||
```
|
||||
|
||||
## SNIPPETS
|
||||
|
||||
Snippets are plugins that run code at the start of the shell. Snippets must be placed inside a sub directory named conf.d.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Install plugins from multiple sources.
|
||||
|
||||
```fish
|
||||
fisher install fishtape superman ~/plugins/my_plugin
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
fisher help uninstall<br>
|
|
@ -1,78 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-LIST" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-list\fR \- List installed plugins
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher list [\fIfile\fR]
|
||||
.
|
||||
.br
|
||||
fisher list [\-\-bare] [\-\-link] [\-\-enabled] [\-\-disabled] [\-\-help]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher list [\fIfile\fR]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
The list command displays all the plugins you have installed\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
* spin
|
||||
> superman
|
||||
@ wipe
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The legend consists of:
|
||||
.
|
||||
.P
|
||||
\fB*\fR Indicate the plugin is installed
|
||||
.
|
||||
.br
|
||||
\fB>\fR Indicate the plugin is a prompt
|
||||
.
|
||||
.br
|
||||
\fB@\fR Indicate the plugin is a symbolic link
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-b, \-\-bare
|
||||
List plugin without decorators
|
||||
.
|
||||
.TP
|
||||
\-l, \-\-link
|
||||
List plugins that are symbolic links
|
||||
.
|
||||
.TP
|
||||
\-\-enabled
|
||||
List plugins that are enabled
|
||||
.
|
||||
.TP
|
||||
\-\-disabled
|
||||
List plugins that are disabled
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher help search
|
||||
.
|
||||
.br
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
fisher-list(1) -- List installed plugins
|
||||
========================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher list [*file*]<br>
|
||||
fisher list [--enabled] [--disabled] [--help]<br>
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher list [*file*]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The list command displays all the plugins that are currently installed.
|
||||
|
||||
```
|
||||
fisher list
|
||||
debug
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ wipe
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
`>` Indicate the plugin is a prompt<br>
|
||||
`@` Indicate the plugin is a symbolic link<br>
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* --enabled:
|
||||
List plugins that are enabled.
|
||||
|
||||
* --disabled:
|
||||
List plugins that are not installed, but available in the cache.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
fisher help search<br>
|
|
@ -1,226 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-SEARCH" "1" "February 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-search\fR \- Search plugin index
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher search [\fIplugins\fR \.\.\.]
|
||||
.
|
||||
.br
|
||||
fisher search [\-\-name|\-\-url|\-\-info|\-\-tag|\-\-author]
|
||||
.
|
||||
.br
|
||||
fisher search [\-\-and] [\-\-or] [\-\-quiet] [\-\-help]
|
||||
.
|
||||
.br
|
||||
fisher search [\-\-long|\-\-full] [\-\-no\-color]
|
||||
.
|
||||
.br
|
||||
fisher search [\-\-query=\fIfield\fR[&&,||]\fIfield\fR\.\.\.]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher search \fIurl\fR
|
||||
.
|
||||
.br
|
||||
fisher search \fIname\fR
|
||||
.
|
||||
.br
|
||||
fisher search \fIowner/repo\fR
|
||||
.
|
||||
.br
|
||||
fisher search \fIquery\fR
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Search plugins in the Fisherman index\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search
|
||||
\.\.\.
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash\-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
\.\.\.
|
||||
> superman Powerline prompt based on Superman
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Get detailed information about a plugin\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search superman
|
||||
> superman by bucaran
|
||||
Powerline prompt based on Superman
|
||||
github\.com/fishery/superman
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Search plugins using tags\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-tag={git,test}
|
||||
\.\.\.
|
||||
* fishtape TAP producing test runner
|
||||
git\-branch\-name Get the name of the current Git branch
|
||||
git\-is\-repo Test if the current directory is a Git repo
|
||||
git\-is\-dirty Test if there are changes not staged for commit
|
||||
git\-is\-stashed Test if there are changes in the stash
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The legend consists of:
|
||||
.
|
||||
.P
|
||||
\fB*\fR Indicate the plugin is currently installed
|
||||
.
|
||||
.br
|
||||
\fB>\fR Indicate the plugin is a prompt
|
||||
.
|
||||
.br
|
||||
\fB@\fR Indicate the plugin is a symbolic link
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-\-\fIfield\fR[=\fImatch\fR]
|
||||
Display index records where \fIfield\fR equals \fImatch\fR\. \fIfield\fR can be any of name, url, info, tag/s or author\. If \fImatch\fR is not given, display only the given \fIfield\fR from every record in the index\. Use != to negate the query\.
|
||||
.
|
||||
.TP
|
||||
\-\-\fIfield\fR[~/regex/]
|
||||
Same as \-\-\fIfield\fR[=\fImatch\fR], but using Regular Expressions\. Use !~ to negate the query\.
|
||||
.
|
||||
.TP
|
||||
\-\-long
|
||||
Display results in long format\.
|
||||
.
|
||||
.TP
|
||||
\-\-full
|
||||
Display results in full format\.
|
||||
.
|
||||
.TP
|
||||
\-\-no\-color
|
||||
Turn off color display\.
|
||||
.
|
||||
.TP
|
||||
\-a, \-\-and
|
||||
Join the query with a logical AND operator\.
|
||||
.
|
||||
.TP
|
||||
\-o, \-\-or
|
||||
Join the query with a logical OR operator\. This is the default operator\.
|
||||
.
|
||||
.TP
|
||||
\-q, \-\-quiet
|
||||
Enable quiet mode\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show help\.
|
||||
.
|
||||
.SH "RESULTS"
|
||||
Search prints results records in the same line, when using one or more of the following options: \-\-name, \-\-url, \-\-info, \-\-tags, \-\-author\. This allows you to parse search results easily\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search shark \-\-name \-\-url \-\-author
|
||||
|
||||
shark;https://github\.com/fishery/shark;bucaran
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Display plugins by name and format the result into multiple columns\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-name | column
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Display plugins by URL, remove \fIhttps://github\.com/\fR and format into multiple columns\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-url | sed \'s|https://github\.com/||\' | column
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Display remote plugins, i\.e, those in the index, but \fInot\fR in the cache\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-and \-\-name!=(fisher \-\-list=bare)
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Search all plugins whose name does not start with the letter s\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-name!~/^s/
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
|
@ -1,128 +0,0 @@
|
|||
fisher-search(1) -- Search plugin index
|
||||
=======================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher search [*plugins* ...]<br>
|
||||
fisher search [--name|--url|--info|--tag|--author]<br>
|
||||
fisher search [--and] [--or] [--quiet] [--help]<br>
|
||||
fisher search [--long|--full] [--no-color]<br>
|
||||
fisher search [--query=*field*[&&,||]*field*...]<br>
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher search *url*<br>
|
||||
fisher search *name*<br>
|
||||
fisher search *owner/repo*<br>
|
||||
fisher search *query*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Search plugins in the Fisherman index.
|
||||
|
||||
```
|
||||
fisher search
|
||||
...
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> superman Powerline prompt based on Superman
|
||||
...
|
||||
```
|
||||
|
||||
Get detailed information about a plugin.
|
||||
|
||||
```
|
||||
fisher search superman
|
||||
> superman by bucaran
|
||||
Powerline prompt based on Superman
|
||||
github.com/fishery/superman
|
||||
```
|
||||
|
||||
Search plugins using tags.
|
||||
|
||||
```
|
||||
fisher search --tag={git,test}
|
||||
...
|
||||
* fishtape TAP producing test runner
|
||||
git-branch-name Get the name of the current Git branch
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
...
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
`*` Indicate the plugin is currently installed<br>
|
||||
`>` Indicate the plugin is a prompt<br>
|
||||
`@` Indicate the plugin is a symbolic link<br>
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* --*field*[=*match*]:
|
||||
Display index records where *field* equals *match*. *field* can be any of name, url, info, tag/s or author. If *match* is not given, display only the given *field* from every record in the index. Use != to negate the query.
|
||||
|
||||
* --*field*[~/regex/]:
|
||||
Same as --*field*[=*match*], but using Regular Expressions. Use !~ to negate the query.
|
||||
|
||||
* --long:
|
||||
Display results in long format.
|
||||
|
||||
* --full:
|
||||
Display results in full format.
|
||||
|
||||
* --no-color:
|
||||
Turn off color display.
|
||||
|
||||
* -a, --and:
|
||||
Join the query with a logical AND operator.
|
||||
|
||||
* -o, --or:
|
||||
Join the query with a logical OR operator. This is the default operator.
|
||||
|
||||
* -q, --quiet:
|
||||
Enable quiet mode.
|
||||
|
||||
* -h, --help:
|
||||
Show help.
|
||||
|
||||
## RESULTS
|
||||
|
||||
Search prints results records in the same line, when using one or more of the following options: --name, --url, --info, --tags, --author. This allows you to parse search results easily.
|
||||
|
||||
```fish
|
||||
fisher search shark --name --url --author
|
||||
|
||||
shark;https://github.com/fishery/shark;bucaran
|
||||
```
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Display plugins by name and format the result into multiple columns.
|
||||
|
||||
```fish
|
||||
fisher search --name | column
|
||||
```
|
||||
|
||||
* Display plugins by URL, remove *https://github.com/* and format into multiple columns.
|
||||
|
||||
```fish
|
||||
fisher search --url | sed 's|https://github.com/||' | column
|
||||
```
|
||||
|
||||
* Display remote plugins, i.e, those in the index, but *not* in the cache.
|
||||
|
||||
```fish
|
||||
fisher search --and --name!=(fisher --list=bare)
|
||||
```
|
||||
|
||||
* Search all plugins whose name does not start with the letter s.
|
||||
|
||||
```fish
|
||||
fisher search --name!~/^s/
|
||||
```
|
|
@ -1 +0,0 @@
|
|||
fisher.1
|
|
@ -1,75 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-UNINSTALL" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-uninstall\fR \- Uninstall plugins
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher uninstall [\fIplugins\fR \.\.\.]
|
||||
.
|
||||
.br
|
||||
fisher uninstall [\-\-force] [\-\-quiet] [\-\-help]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher uninstall \fIurl\fR
|
||||
.
|
||||
.br
|
||||
fisher uninstall \fIname\fR
|
||||
.
|
||||
.br
|
||||
fisher uninstall \fIpath\fR
|
||||
.
|
||||
.br
|
||||
fisher uninstall \fIowner/repo\fR
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Uninstall one or more plugins\. If no arguments are given, read the standard input\.
|
||||
.
|
||||
.P
|
||||
Uninstall does not remove any copies of the given plugin in $fisher_cache\. To erase the copy from the cache, use the \-\-force option\.
|
||||
.
|
||||
.P
|
||||
Uninstall does not remove any dependencies installed with other plugins\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-f, \-\-force
|
||||
Delete copy from cache\.
|
||||
.
|
||||
.TP
|
||||
\-q, \-\-quiet
|
||||
Enable quiet mode\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Uninstall all plugins flushing the cache\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list | fisher uninstall \-\-force
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher help install
|
||||
.
|
||||
.br
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
fisher-uninstall(1) -- Uninstall plugins
|
||||
========================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher uninstall [*plugins* ...]<br>
|
||||
fisher uninstall [--force] [--quiet] [--help]<br>
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher uninstall *url*<br>
|
||||
fisher uninstall *name*<br>
|
||||
fisher uninstall *path* <br>
|
||||
fisher uninstall *owner/repo*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Uninstall one or more plugins. If no arguments are given, read the standard input.
|
||||
|
||||
Uninstall does not remove any copies of the given plugin in $fisher_cache. To erase the copy from the cache, use the --force option.
|
||||
|
||||
Uninstall does not remove any dependencies installed with other plugins.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -f, --force:
|
||||
Delete copy from cache.
|
||||
|
||||
* -q, --quiet:
|
||||
Enable quiet mode.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Uninstall all plugins flushing the cache.
|
||||
|
||||
```fish
|
||||
fisher list | fisher uninstall --force
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
fisher help install<br>
|
|
@ -1,72 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-UPDATE" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-update\fR \- Update plugins
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher update [\fIplugins\fR \.\.\.] [\-\-quiet] [\-\-help]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "USAGE"
|
||||
fisher update \fIurl\fR \.\.\.
|
||||
.
|
||||
.br
|
||||
fisher update \fIname\fR \.\.\.
|
||||
.
|
||||
.br
|
||||
fisher update \fIpath\fR \.\.\.
|
||||
.
|
||||
.br
|
||||
fisher update \fIowner/repo\fR \.\.\.
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Update one or more plugins concurrently\. If no arguments are given, update everything, including Fisherman\. Use a dash \fB\-\fR to read from the standard input\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-q, \-\-quiet
|
||||
Enable quiet mode\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Update Fisherman\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher update
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Update all the plugins in the cache\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list | fisher update \-
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
fisher-update(1) -- Update plugins
|
||||
==================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher update [*plugins* ...] [--quiet] [--help] <br>
|
||||
|
||||
## USAGE
|
||||
|
||||
fisher update *url* ...<br>
|
||||
fisher update *name* ...<br>
|
||||
fisher update *path* ...<br>
|
||||
fisher update *owner/repo* ...<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Update one or more plugins concurrently. If no arguments are given, update everything, including Fisherman. Use a dash `-` to read from the standard input.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -q, --quiet:
|
||||
Enable quiet mode.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Update Fisherman.
|
||||
|
||||
```fish
|
||||
fisher update
|
||||
```
|
||||
|
||||
* Update all the plugins in the cache.
|
||||
|
||||
```fish
|
||||
fisher list | fisher update -
|
||||
```
|
|
@ -1,727 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\fR \- Fish plugin manager
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
fisher \fIcommand\fR [\fIoptions\fR] [\-\-version] [\-\-help]
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Fisherman is a plugin manager for fish\.
|
||||
.
|
||||
.P
|
||||
The Fisherman CLI consists of: \fIinstall\fR, \fIupdate\fR, \fIuninstall\fR, \fIlist\fR, \fIsearch\fR and \fIhelp\fR and the following aliases: \fIi\fR for install, \fIu\fR for update, \fIl\fR for list, \fIs\fR for search and \fIh\fR for help\.
|
||||
.
|
||||
.SH "USAGE"
|
||||
Run a command\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher <command> [<options>]
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Get help about a command\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher help <command>
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\-v, \-\-version
|
||||
Show version information\. Fisherman follows Semantic Versioning and uses Git annotated tags to track releases\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install plugins\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher i fishtape shark get bobthefish
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install Oh My Fish! plugins\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher i omf/plugin\-{percol,jump,fasd}
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install a plugin from a local directory\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher i \./path/to/plugin
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install a plugin from various URLs\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher i https://github\.com/some/plugin another/plugin bb:one/more
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Install a plugin from a Gist\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher i gist\.github\.com/owner/1f40e1c6e0551b2666b2
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Update everything\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher u
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Update plugins\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher u shark get
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Uninstall plugins\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher uninstall fishtape debug
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Get help\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher h
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "LIST AND SEARCH"
|
||||
The list command displays all the plugins you have installed\. The search command queries the index to show what\'s available to install\.
|
||||
.
|
||||
.P
|
||||
List installed plugins\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> superman
|
||||
* spin
|
||||
@ wipe
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Search the index\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search
|
||||
\.\.\.
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash\-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
\.\.\.
|
||||
> superman Powerline prompt based on Superman
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Query the index using regular expressions\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-name~/git\-is/
|
||||
git\-is\-dirty Test if there are changes not staged for commit
|
||||
git\-is\-empty Test if a repository is empty
|
||||
git\-is\-repo Test if the current directory is a Git repo
|
||||
git\-is\-staged Test if there are changes staged for commit
|
||||
git\-is\-stashed Test if there are changes in the stash
|
||||
git\-is\-touched Test if there are changes in the working tree
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Search using tags\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher search \-\-tag={git,test}
|
||||
\.\.\.
|
||||
* fishtape TAP producing test runner
|
||||
git\-branch\-name Get the name of the current Git branch
|
||||
git\-is\-dirty Test if there are changes not staged for commit
|
||||
git\-is\-empty Test if a repository is empty
|
||||
git\-is\-repo Test if the current directory is a Git repo
|
||||
git\-is\-staged Test if there are changes staged for commit
|
||||
git\-is\-stashed Test if there are changes in the stash
|
||||
git\-is\-touched Test if there are changes in the working tree
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The legend consists of:
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fB*\fR The plugin is enabled
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fB>\fR The plugin is a prompt
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fB@\fR The plugin is a symbolic link
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "PLUMBING"
|
||||
Fisherman commands are pipe aware\. Plumb one with another to create complex functionality\.
|
||||
.
|
||||
.P
|
||||
Update plugins installed as symbolic links\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list \-\-link | fisher update \-
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Enable all the plugins currently disabled\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list \-\-disabled | fisher install
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Uninstall all the plugins and remove them from the cache\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher list | fisher uninstall \-\-force
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "DOTFILES"
|
||||
When you install a plugin, Fisherman updates the \fIfishfile\fR to track what plugins are currently enabled\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Customize the location of the fishfile\.
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
set \-g fisher_file ~/\.dotfiles/fishfile
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "FLAT TREE"
|
||||
Fisherman merges the directory trees of all the plugins it installs into a single flat tree\. Since the flat tree is loaded only once at the start of the shell, Fisherman performs equally well, regardless of the number of plugins installed\.
|
||||
.
|
||||
.P
|
||||
The following illustrates an example Fisherman configuration path with a single plugin and prompt\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
$fisher_config
|
||||
|\-\- cache/
|
||||
|\-\- conf\.d/
|
||||
| `\-\- my_plugin\.fish
|
||||
|\-\- fishfile
|
||||
|\-\- functions/
|
||||
| |\-\- my_plugin\.fish
|
||||
| |\-\- fish_prompt\.fish
|
||||
| `\-\- fish_right_prompt\.fish
|
||||
|\-\- completions/
|
||||
| `\-\- my_plugin\.fish
|
||||
`\-\- man/
|
||||
`\-\- man1/
|
||||
`\-\- my_plugin\.1
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "INDEX"
|
||||
The index is a plain text database that lists Fisherman official plugins\.
|
||||
.
|
||||
.P
|
||||
The index lists records, each consisting the fields: \fIname\fR, \fIurl\fR, \fIinfo\fR, one or more \fItags\fR and \fIauthor\fR\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
z
|
||||
https://github\.com/fishery/fish\-z
|
||||
Pure\-fish z directory jumping
|
||||
z search cd jump
|
||||
jethrokuan
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
If you have a plugin you would like to submit to the index, use the submit plugin\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install submit
|
||||
fisher submit my_plugin description tags url
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Or, submit the plugin manually by creating a pull request in the index \fIhttps://github\.com/fisherman/fisher\-index\fR repository\.
|
||||
.
|
||||
.SH "VARIABLES"
|
||||
.
|
||||
.TP
|
||||
$fisher_home
|
||||
The home directory\. If you installed Fisherman using the recommended method, the location ought to be \fIXDG_DATA_HOME/fisherman\fR\.
|
||||
.
|
||||
.TP
|
||||
$fisher_config
|
||||
The configuration directory\. This is default location of your \fIfishfile\fR, \fIkey_bindings\.fish\fR, \fIcache\fR, \fIfunctions\fR, \fIcompletions\fR and \fIconf\.d\fR directories\. \fIXDG_CONFIG_HOME/fisherman\fR by default\.
|
||||
.
|
||||
.TP
|
||||
$fisher_file
|
||||
See FISHFILE above\.
|
||||
.
|
||||
.TP
|
||||
$fisher_cache
|
||||
The cache directory\. Plugins are downloaded to this location\.
|
||||
.
|
||||
.TP
|
||||
$fisher_alias \fIcommand\fR=\fIalias\fR \.\.\.
|
||||
Use this variable to create aliases of Fisherman commands\.
|
||||
.
|
||||
.SH "PLUGINS"
|
||||
Plugins can be utilities, prompts, commands or snippets\. To create a plugin from a template, install the new command\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install new
|
||||
fisher new plugin < meta\.yml
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
See the documentation of new for details\.
|
||||
.
|
||||
.SS "UTILITIES"
|
||||
Utilities are plugins that define one or more functions\.
|
||||
.
|
||||
.P
|
||||
Below is a plugin based in ngerakines/commitment \fIhttps://github/ngerakines/commitment\fR random commit message generator\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
mkdir wtc
|
||||
cd wtc
|
||||
|
||||
function wtc \-d "Generate a random commit message"
|
||||
switch "$argv"
|
||||
case \-h \-\-help
|
||||
printf "Usage: wtc [\-\-help]\en\en"
|
||||
printf " \-h \-\-help Show usage help\en"
|
||||
return
|
||||
end
|
||||
curl \-s whatthecommit\.com/index\.txt
|
||||
end
|
||||
functions wtc > wtc\.fish
|
||||
|
||||
fisher install \.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
wtc
|
||||
(\e /)
|
||||
(O\.o)
|
||||
(> <) Bunny approves these changes\.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
To submit wtc to the official index\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher submit wtc "Random commit message generator" "commit random fun" https://github\.com/owner/wtc
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
This will create a PR in the Fisherman index repository\. Once the PR is approved, Fisherman users will be able to install wtc if they have the latest index\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install wtc
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
A plugin can list dependencies to other plugins using a \fIfishfile\fR\.
|
||||
.
|
||||
.P
|
||||
Create a \fIfishfile\fR in the root of your project and add the name or URL of your dependencies\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
my_plugin
|
||||
https://github\.com/owner/another_plugin
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SS "PROMPTS"
|
||||
Prompts, or themes, are plugins that modify the appearance of the shell prompt and colors\.
|
||||
.
|
||||
.P
|
||||
Create a \fBfish_prompt\fR function\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
function fish_prompt
|
||||
printf "%s (%s) >> " (prompt_pwd) Fisherman
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
~ (Fisherman) >> type here
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
To add a right prompt, create a \fBfish_right_prompt\fR function\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
function fish_right_prompt
|
||||
printf "%s" (date +%H:%M:%S)
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Save the functions to a directory and install the prompt as a plugin\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
mkdir my_prompt
|
||||
cd my_prompt
|
||||
|
||||
functions fish_prompt > fish_prompt\.fish
|
||||
functions fish_right_prompt > fish_right_prompt\.fish
|
||||
|
||||
fisher install \.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Customize the colors fish uses for syntax highlighting\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
function set_color_custom
|
||||
# set \-U fish_color_normal
|
||||
# set \-U fish_color_command
|
||||
# set \-U fish_color_param
|
||||
# set \-U fish_color_redirection
|
||||
# set \-U fish_color_comment
|
||||
# set \-U fish_color_error
|
||||
# set \-U fish_color_escape
|
||||
# set \-U fish_color_operator
|
||||
# set \-U fish_color_end
|
||||
# set \-U fish_color_quote
|
||||
# set \-U fish_color_autosuggestion
|
||||
# set \-U fish_color_valid_path
|
||||
# set \-U fish_color_cwd
|
||||
# set \-U fish_color_cwd_root
|
||||
# set \-U fish_color_match
|
||||
# set \-U fish_color_search_match
|
||||
# set \-U fish_color_selection
|
||||
# set \-U fish_pager_color_prefix
|
||||
# set \-U fish_pager_color_completion
|
||||
# set \-U fish_pager_color_description
|
||||
# set \-U fish_pager_color_progress
|
||||
# set \-U fish_color_history_current
|
||||
end
|
||||
|
||||
functions set_color_custom > set_color_custom\.fish
|
||||
|
||||
fisher update \.
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SS "COMMANDS"
|
||||
Commands are plugins that extend the Fisherman CLI adding new \fBfisher <commands>\fR\.
|
||||
.
|
||||
.P
|
||||
Create a function \fBfisher_<command>\fR
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
function fisher_time \-d "Say hello"
|
||||
printf "It\'s %s\en" (date +%H:%M)
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Test it works
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher time
|
||||
It\'s 6:30
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Make it a plugin
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install fisher_time
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SS "SNIPPETS"
|
||||
Snippets are plugins that run code at the start of the shell\. Snippets must be placed inside a sub directory named conf\.d\.
|
||||
.
|
||||
.P
|
||||
The following example implements a fish_postexec hook to display the duration of the last command in milliseconds\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
mkdir \-p runtime/conf\.d
|
||||
cd runtime
|
||||
$EDITOR conf\.d/fish_postexec\.fish
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
function fish_postexec \-\-on\-event fish_postexec
|
||||
printf "%sms\en" $CMD_DURATION > /dev/stderr
|
||||
end
|
||||
|
||||
fisher install \./postexec
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "AUTHORS"
|
||||
Fisherman was created by Jorge Bucaran :: @bucaran :: \fIj@bucaran\.me\fR\.
|
||||
.
|
||||
.P
|
||||
See THANKS\.md file for a complete list of contributors\.
|
|
@ -1,435 +0,0 @@
|
|||
fisher(1) -- fish plugin manager
|
||||
================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher *command* [*options*] [--version] [--help]<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Fisherman is a plugin manager for fish.
|
||||
|
||||
The Fisherman CLI consists of: *install*, *update*, *uninstall*, *list*, *search* and *help* and the following aliases: *i* for install, *u* for update, *l* for list, *s* for search, *r* for uninstall and *h* for help.
|
||||
|
||||
## USAGE
|
||||
|
||||
Run a command.
|
||||
|
||||
```
|
||||
fisher <command> [<options>]
|
||||
```
|
||||
|
||||
Get help about a command.
|
||||
|
||||
```
|
||||
fisher help <command>
|
||||
```
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -v, --version:
|
||||
Show version information. Fisherman follows Semantic Versioning and uses Git annotated tags to track releases.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Install plugins.
|
||||
|
||||
```
|
||||
fisher i fishtape shark get bobthefish
|
||||
```
|
||||
|
||||
* Install oh-my-fish plugins.
|
||||
|
||||
```fish
|
||||
fisher i omf/plugin-{percol,jump,fasd}
|
||||
```
|
||||
|
||||
* Install a plugin from a local directory.
|
||||
|
||||
```fish
|
||||
fisher i ./path/to/plugin
|
||||
```
|
||||
|
||||
* Install a plugin from various URLs.
|
||||
|
||||
```fish
|
||||
fisher i https://github.com/some/plugin another/plugin bb:one/more
|
||||
```
|
||||
|
||||
* Install a plugin from a gist.
|
||||
|
||||
```fish
|
||||
fisher i gist.github.com/owner/1f40e1c6e0551b2666b2
|
||||
```
|
||||
|
||||
* Update everything.
|
||||
|
||||
```
|
||||
fisher u
|
||||
```
|
||||
|
||||
* Update plugins.
|
||||
|
||||
```
|
||||
fisher u shark get
|
||||
```
|
||||
|
||||
* Uninstall plugins.
|
||||
|
||||
```
|
||||
fisher uninstall fishtape debug
|
||||
```
|
||||
|
||||
* Get help.
|
||||
|
||||
```fish
|
||||
fisher h
|
||||
```
|
||||
|
||||
## LIST AND SEARCH
|
||||
|
||||
The list command displays all the plugins you have installed. The search command queries the index to show what's available to install.
|
||||
|
||||
List installed plugins.
|
||||
|
||||
```
|
||||
fisher list
|
||||
debug
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ my_aliases
|
||||
```
|
||||
|
||||
Search the index.
|
||||
|
||||
```
|
||||
fisher search
|
||||
...
|
||||
* debug Conditional debug logger
|
||||
errno POSIX error code/string translator
|
||||
* fishtape TAP producing test runner
|
||||
flash Flash-inspired, thunder prompt
|
||||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> superman Powerline prompt optimized for speed
|
||||
...
|
||||
```
|
||||
|
||||
Query the index using regular expressions.
|
||||
|
||||
```
|
||||
fisher search --name~/git-is/
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
```
|
||||
|
||||
Search using tags.
|
||||
|
||||
```
|
||||
fisher search --tag={git,test}
|
||||
...
|
||||
* fishtape TAP producing test runner
|
||||
git-branch-name Get the name of the current Git branch
|
||||
git-is-dirty Test if there are changes not staged for commit
|
||||
git-is-empty Test if a repository is empty
|
||||
git-is-repo Test if the current directory is a Git repo
|
||||
git-is-staged Test if there are changes staged for commit
|
||||
git-is-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
...
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
* `*` The plugin is installed
|
||||
* `>` The plugin is a prompt
|
||||
* `@` The plugin is a symbolic link
|
||||
|
||||
## PLUMBING
|
||||
|
||||
Fisherman commands are pipe aware. Plumb one with another to create complex functionality.
|
||||
|
||||
Update plugins installed as symbolic links.
|
||||
|
||||
```fish
|
||||
fisher list --link | fisher update -
|
||||
```
|
||||
|
||||
Enable all the plugins currently disabled.
|
||||
|
||||
```fish
|
||||
fisher list --disabled | fisher install
|
||||
```
|
||||
|
||||
Uninstall all the plugins and remove them from the cache.
|
||||
|
||||
```fish
|
||||
fisher list | fisher uninstall --force
|
||||
```
|
||||
|
||||
## DOTFILES
|
||||
|
||||
When you install a plugin, Fisherman updates the *fishfile* to track what plugins are currently enabled.
|
||||
|
||||
* Customize the location of the fishfile.
|
||||
|
||||
```fish
|
||||
set -g fisher_file ~/.dotfiles/fishfile
|
||||
```
|
||||
|
||||
## FLAT TREE
|
||||
|
||||
Fisherman merges the directory trees of all the plugins it installs into a single flat tree. Since the flat tree is loaded only once at the start of the shell, Fisherman performs equally well, regardless of the number of plugins installed.
|
||||
|
||||
The following illustrates an example Fisherman configuration path with a single plugin and prompt.
|
||||
|
||||
```
|
||||
$fisher_config
|
||||
|-- cache/
|
||||
|-- conf.d/
|
||||
| `-- my_plugin.fish
|
||||
|-- fishfile
|
||||
|-- functions/
|
||||
| |-- my_plugin.fish
|
||||
| |-- fish_prompt.fish
|
||||
| `-- fish_right_prompt.fish
|
||||
|-- completions/
|
||||
| `-- my_plugin.fish
|
||||
`-- man/
|
||||
`-- man1/
|
||||
`-- my_plugin.1
|
||||
```
|
||||
|
||||
## INDEX
|
||||
|
||||
The index is a plain text database that lists Fisherman official plugins.
|
||||
|
||||
The index lists records, each consisting the fields: *name*, *url*, *info*, one or more *tags* and *author*.
|
||||
|
||||
```
|
||||
z
|
||||
https://github.com/fishery/fish-z
|
||||
Pure-fish z directory jumping
|
||||
z search cd jump
|
||||
jethrokuan
|
||||
```
|
||||
|
||||
If you have a plugin you would like to submit to the index, use the submit plugin.
|
||||
|
||||
```
|
||||
fisher install submit
|
||||
fisher submit my_plugin description tags url
|
||||
```
|
||||
|
||||
Or, submit the plugin manually by creating a pull request in the [index](https://github.com/fisherman/fisher-index) repository.
|
||||
|
||||
## VARIABLES
|
||||
|
||||
* $fisher_home:
|
||||
The home directory. If you installed Fisherman using the recommended method, the location ought to be *XDG_DATA_HOME/fisherman*.
|
||||
|
||||
* $fisher_config:
|
||||
The configuration directory. This is default location of your *fishfile*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* directories. *XDG_CONFIG_HOME/fisherman* by default.
|
||||
|
||||
* $fisher_file:
|
||||
See FISHFILE above.
|
||||
|
||||
* $fisher_cache:
|
||||
The cache directory. Plugins are downloaded to this location.
|
||||
|
||||
* $fisher_alias *command*=*alias* ...:
|
||||
Use this variable to create aliases of Fisherman commands.
|
||||
|
||||
|
||||
## PLUGINS
|
||||
|
||||
Plugins can be utilities, prompts, commands or snippets. To create a plugin from a template, install the new command.
|
||||
|
||||
```
|
||||
fisher install new
|
||||
fisher new plugin < meta.yml
|
||||
```
|
||||
|
||||
See the documentation of new for details.
|
||||
|
||||
### UTILITIES
|
||||
|
||||
Utilities are plugins that define one or more functions.
|
||||
|
||||
Below is a plugin based in [ngerakines/commitment](https://github/ngerakines/commitment) random commit message generator.
|
||||
|
||||
```fish
|
||||
mkdir wtc
|
||||
cd wtc
|
||||
|
||||
function wtc -d "Generate a random commit message"
|
||||
switch "$argv"
|
||||
case -h --help
|
||||
printf "Usage: wtc [--help]\n\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
end
|
||||
curl -s whatthecommit.com/index.txt
|
||||
end
|
||||
functions wtc > wtc.fish
|
||||
|
||||
fisher install .
|
||||
```
|
||||
```
|
||||
wtc
|
||||
(\ /)
|
||||
(O.o)
|
||||
(> <) Bunny approves these changes.
|
||||
```
|
||||
|
||||
#### SUBMIT
|
||||
|
||||
To submit wtc to the official index.
|
||||
|
||||
```fish
|
||||
fisher submit wtc "Random commit message generator" "commit random fun" https://github.com/owner/wtc
|
||||
```
|
||||
|
||||
This will create a PR in the Fisherman index repository. Once the PR is approved, Fisherman users will be able to install wtc if they have the latest index.
|
||||
|
||||
```fish
|
||||
fisher install wtc
|
||||
```
|
||||
|
||||
#### DEPENDENCIES
|
||||
|
||||
A plugin can list dependencies to other plugins using a *fishfile*.
|
||||
|
||||
Create a *fishfile* in the root of your project and add the name or URL of your dependencies.
|
||||
|
||||
```
|
||||
my_plugin
|
||||
https://github.com/owner/another_plugin
|
||||
```
|
||||
|
||||
### PROMPTS
|
||||
|
||||
Prompts, or themes, are plugins that modify the appearance of the shell prompt and colors.
|
||||
|
||||
Create a `fish_prompt` function.
|
||||
|
||||
```fish
|
||||
function fish_prompt
|
||||
printf "%s (%s) >> " (prompt_pwd) Fisherman
|
||||
end
|
||||
```
|
||||
```
|
||||
~ (Fisherman) >> type here
|
||||
```
|
||||
To add a right prompt, create a `fish_right_prompt` function.
|
||||
|
||||
```fish
|
||||
function fish_right_prompt
|
||||
printf "%s" (date +%H:%M:%S)
|
||||
end
|
||||
```
|
||||
|
||||
Save the functions to a directory and install the prompt as a plugin.
|
||||
|
||||
```fish
|
||||
mkdir my_prompt
|
||||
cd my_prompt
|
||||
|
||||
functions fish_prompt > fish_prompt.fish
|
||||
functions fish_right_prompt > fish_right_prompt.fish
|
||||
|
||||
fisher install .
|
||||
```
|
||||
|
||||
Customize the colors fish uses for syntax highlighting.
|
||||
|
||||
```fish
|
||||
function set_color_custom
|
||||
# set -U fish_color_normal
|
||||
# set -U fish_color_command
|
||||
# set -U fish_color_param
|
||||
# set -U fish_color_redirection
|
||||
# set -U fish_color_comment
|
||||
# set -U fish_color_error
|
||||
# set -U fish_color_escape
|
||||
# set -U fish_color_operator
|
||||
# set -U fish_color_end
|
||||
# set -U fish_color_quote
|
||||
# set -U fish_color_autosuggestion
|
||||
# set -U fish_color_valid_path
|
||||
# set -U fish_color_cwd
|
||||
# set -U fish_color_cwd_root
|
||||
# set -U fish_color_match
|
||||
# set -U fish_color_search_match
|
||||
# set -U fish_color_selection
|
||||
# set -U fish_pager_color_prefix
|
||||
# set -U fish_pager_color_completion
|
||||
# set -U fish_pager_color_description
|
||||
# set -U fish_pager_color_progress
|
||||
# set -U fish_color_history_current
|
||||
end
|
||||
|
||||
functions set_color_custom > set_color_custom.fish
|
||||
|
||||
fisher update .
|
||||
```
|
||||
|
||||
### COMMANDS
|
||||
|
||||
Commands are plugins that extend the Fisherman CLI adding new `fisher <commands>`.
|
||||
|
||||
Create a function `fisher_<command>`
|
||||
|
||||
```fish
|
||||
function fisher_time -d "Say hello"
|
||||
printf "It's %s\n" (date +%H:%M)
|
||||
end
|
||||
```
|
||||
|
||||
Test it works
|
||||
|
||||
```fish
|
||||
fisher time
|
||||
It's 6:30
|
||||
```
|
||||
|
||||
Make it a plugin
|
||||
|
||||
```fish
|
||||
fisher install fisher_time
|
||||
```
|
||||
|
||||
### SNIPPETS
|
||||
|
||||
Snippets are plugins that run code at the start of the shell. Snippets must be placed inside a sub directory named conf.d.
|
||||
|
||||
The following example implements a fish_postexec hook to display the duration of the last command in milliseconds.
|
||||
|
||||
```fish
|
||||
mkdir -p runtime/conf.d
|
||||
cd runtime
|
||||
$EDITOR conf.d/fish_postexec.fish
|
||||
```
|
||||
|
||||
```fish
|
||||
function fish_postexec --on-event fish_postexec
|
||||
printf "%sms\n" $CMD_DURATION > /dev/stderr
|
||||
end
|
||||
|
||||
fisher install ./postexec
|
||||
```
|
||||
|
||||
## AUTHORS
|
||||
|
||||
Fisherman was created by Jorge Bucaran :: @bucaran :: *j@bucaran.me*.
|
||||
|
||||
See THANKS.md file for a complete list of contributors.
|
|
@ -1 +0,0 @@
|
|||
fisher.1
|
|
@ -1,69 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GETOPTS" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgetopts\fR \- Command line options parser
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
getopts \fIoptions\fR \.\.\.
|
||||
.
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
\fBGetopts\fR is a command line options parser for fish\.
|
||||
.
|
||||
.SH "USAGE"
|
||||
Study the output of getopts in the following example
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
getopts \-ab1 \-\-foo=bar baz
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
a
|
||||
b 1
|
||||
foo bar
|
||||
_ baz
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The items on the left are the command option \fIkeys\fR\. The items on the right are the option \fIvalues\fR\. The underscore \fB_\fR character is the default key for bare arguments\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
getopts \-ab1 \-\-foo=bar baz | while read \-l key option
|
||||
switch $key
|
||||
case _
|
||||
case a
|
||||
case b
|
||||
case foo
|
||||
end
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "NOTES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
A double dash, \fB\-\-\fR, marks the end of options\. Arguments after this sequence are placed in the default underscore key, \fB_\fR\.
|
||||
.
|
||||
.IP "" 0
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
getopts(1) -- Command line options parser
|
||||
=========================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
getopts *options* ...<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
**Getopts** is a command line options parser for fish.
|
||||
|
||||
## USAGE
|
||||
|
||||
Study the output of getopts in the following example
|
||||
|
||||
```
|
||||
getopts -ab1 --foo=bar baz
|
||||
```
|
||||
|
||||
```
|
||||
a
|
||||
b 1
|
||||
foo bar
|
||||
_ baz
|
||||
```
|
||||
|
||||
The items on the left are the command option *keys*. The items on the right are the option *values*. The underscore `_` character is the default key for bare arguments.
|
||||
|
||||
```
|
||||
getopts -ab1 --foo=bar baz | while read -l key option
|
||||
switch $key
|
||||
case _
|
||||
case a
|
||||
case b
|
||||
case foo
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
## NOTES
|
||||
|
||||
* A double dash, `--`, marks the end of options. Arguments after this sequence are placed in the default underscore key, `_`.
|
|
@ -1,60 +0,0 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "SPIN" "1" "March 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBspin\fR \- Background job spinner
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBspin\fR \fIcommands\fR [\fB\-\-style\fR=\fImix\fR|\fIarc\fR|\fIstar\fR|\fIpipe\fR|\fIflip\fR|\fIbounce\fR|\fIbar1~3\fR]
|
||||
.
|
||||
.br
|
||||
\fBspin\fR \fIcommands\fR [\fB\-\-error\fR=file] [\fB\-\-format\fR=format] [\fB\-\-help\fR]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
\fBSpin\fR is a terminal spinner and progress bar indicator for fish\.
|
||||
.
|
||||
.SH "USAGE"
|
||||
.
|
||||
.nf
|
||||
|
||||
spin "sleep 1"
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.P
|
||||
Spin interprets any output to standard error as failure\. Use \-\-error=\fIfile\fR to redirect the standard error output to \fIfile\fR\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
if not spin \-\-style=pipe \-\-error=debug\.txt "curl \-sS $URL"
|
||||
return 1
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "Options"
|
||||
.
|
||||
.TP
|
||||
\-s, \-\-style=\fIstyle\fR|\fIstring\fR
|
||||
Use \fIstring\fR to slice the spinner characters\. If you don\'t want to display the spinners, use \-\-style=\fI""\fR\.
|
||||
.
|
||||
.TP
|
||||
\-f, \-\-format=\fIformat\fR
|
||||
Use \fIformat\fR to customize the spinner display\. The default format is \fB" @\er"\fR where \fB@\fR represents the spinner token and \fB\er\fR a carriage return, used to refresh (erase) the line\.
|
||||
.
|
||||
.TP
|
||||
\-\-error=\fIfile\fR
|
||||
Write the standard error output to a given \fIfile\fR\.
|
||||
.
|
||||
.TP
|
||||
\-h, \-\-help
|
||||
Show usage help\.
|
||||
.
|
||||
.SS "Customization"
|
||||
Replace the default spinner with your own string of characters\. For example, \-\-style=\fI12345\fR will display the numbers from 1 to 5, and \-\-style=\fI\.\fR \-\-format=\fI@\fR an increasing sequence of dots\.
|
|
@ -1,43 +0,0 @@
|
|||
spin(1) -- Background job spinner
|
||||
=================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`spin` *commands* [`--style`=*mix*|*arc*|*star*|*pipe*|*flip*|*bounce*|*bar1~3*]<br>
|
||||
`spin` *commands* [`--error`=file] [`--format`=format] [`--help`]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
**Spin** is a terminal spinner and progress bar indicator for fish.
|
||||
|
||||
## USAGE
|
||||
|
||||
```fish
|
||||
spin "sleep 1"
|
||||
```
|
||||
|
||||
Spin interprets any output to standard error as failure. Use --error=*file* to redirect the standard error output to *file*.
|
||||
|
||||
```fish
|
||||
if not spin --style=pipe --error=debug.txt "curl -sS $URL"
|
||||
return 1
|
||||
end
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
* -s, --style=*style*|*string*:
|
||||
Use *string* to slice the spinner characters. If you don't want to display the spinners, use --style=*""*.
|
||||
|
||||
* -f, --format=*format*:
|
||||
Use *format* to customize the spinner display. The default format is `" @\r"` where `@` represents the spinner token and `\r` a carriage return, used to refresh (erase) the line.
|
||||
|
||||
* --error=*file*:
|
||||
Write the standard error output to a given *file*.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help.
|
||||
|
||||
### Customization
|
||||
|
||||
Replace the default spinner with your own string of characters. For example, --style=*12345* will display the numbers from 1 to 5, and --style=*.* --format=*@* an increasing sequence of dots.
|
|
@ -1,24 +0,0 @@
|
|||
set -l path $DIRNAME/.t-$TESTNAME-(random)
|
||||
|
||||
function -S setup
|
||||
mkdir -p $path/cache/{foo,bar,baz} $path/norf
|
||||
ln -s $path/norf $path/cache/norf
|
||||
|
||||
set -g fisher_cache $path/cache
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
rm -rf $path
|
||||
end
|
||||
|
||||
test "$TESTNAME - Follow symbolic links"
|
||||
(contains -- norf (__fisher_cache_list); echo $status) -eq 0
|
||||
end
|
||||
|
||||
test "$TESTNAME - List base name of each plugin inside the cache"
|
||||
(__fisher_cache_list) = (
|
||||
for plugin in $fisher_cache/*
|
||||
basename $plugin
|
||||
end
|
||||
)
|
||||
end
|
|
@ -1,25 +0,0 @@
|
|||
set -l path $DIRNAME/.t-$TESTNAME-(random)
|
||||
|
||||
function -S setup
|
||||
mkdir -p $path/completions
|
||||
echo "echo ok" > $path/completions/fisher.fish
|
||||
|
||||
set -g fisher_home $path
|
||||
|
||||
function complete
|
||||
echo $argv
|
||||
end
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
rm -rf $path
|
||||
functions -e complete
|
||||
end
|
||||
|
||||
test "$TESTNAME - Remove Fisherman completions"
|
||||
(__fisher_complete_reset | sed -n 1p) = "-ec fisher"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Evaluate completions/fisher.fish"
|
||||
(__fisher_complete_reset | sed -n 2p) = "ok"
|
||||
end
|
|
@ -1,27 +0,0 @@
|
|||
function -S setup
|
||||
function complete
|
||||
echo $argv
|
||||
end
|
||||
|
||||
function foo
|
||||
echo "-f --foo Foo!"
|
||||
end
|
||||
|
||||
function bar
|
||||
echo "--bar Bar!"
|
||||
end
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
functions -e complete foo bar
|
||||
end
|
||||
|
||||
test "$TESTNAME - Complete short / long options with description"
|
||||
(foo | __fisher_complete norf quux
|
||||
) = "-c norf -s f -l foo -d Foo! -n __fish_seen_subcommand_from quux"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Complete long options with description"
|
||||
(bar | __fisher_complete norf quux
|
||||
) = "-c norf -s -l bar -d Bar! -n __fish_seen_subcommand_from quux"
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
test "$TESTNAME - Todo"
|
||||
-z ""
|
||||
end
|
|
@ -1,24 +0,0 @@
|
|||
set -l path $DIRNAME/.t-$TESTNAME-(random)
|
||||
|
||||
function -S setup
|
||||
mkdir -p $path/{foo,bar}
|
||||
|
||||
__fisher_config_color_save $path/foo/fish_colors
|
||||
|
||||
touch $path/bar/fish_colors
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
rm -rf $path
|
||||
end
|
||||
|
||||
test "$TESTNAME - Create fish_colors in path"
|
||||
-s $path/foo/fish_colors
|
||||
end
|
||||
|
||||
test "$TESTNAME - Create fish_colors in path"
|
||||
1 = (
|
||||
__fisher_config_color_save $path/bar/fish_colors
|
||||
echo $status
|
||||
)
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue