From 85f897104d253f1a6ca78b1b40d6dda7ff1bc729 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Fri, 22 Apr 2016 00:34:06 +0900 Subject: [PATCH] Ahoy my mateys! fisherman 2.0.0 (beta) is here. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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! --- .editorconfig | 7 - .gitignore | 1 - .travis.yml | 4 +- CHANGELOG.md | 409 ---- CODE_OF_CONDUCT.md | 27 - CONTRIBUTING.md | 33 - LICENSE | 29 +- README.md | 383 ++-- THANKS.md | 19 - VERSION | 1 - bin/install | 183 -- completions/fisher.fish | 37 - completions/getopts.fish | 1 - completions/spin.fish | 2 - config.fish | 10 - docs/.DS_Store | Bin 0 -> 6148 bytes docs/es-ES/README.md | 258 +++ docs/jp-JA/README.md | 18 + docs/zh-CN/README.md | 260 +-- fisher.fish | 1895 +++++++++++++++++ functions/__fisher_cache_list.fish | 3 - functions/__fisher_complete.fish | 13 - functions/__fisher_complete_reset.fish | 4 - functions/__fisher_config_color_reset.fish | 63 - functions/__fisher_config_color_save.fish | 31 - functions/__fisher_file.fish | 21 - functions/__fisher_file_contains.fish | 4 - functions/__fisher_file_remove.fish | 13 - functions/__fisher_gist_to_name.fish | 21 - functions/__fisher_help_commands.fish | 20 - functions/__fisher_help_parse.fish | 3 - functions/__fisher_help_usage.fish | 14 - functions/__fisher_index_update.fish | 29 - functions/__fisher_key_bindings.fish | 3 - functions/__fisher_key_bindings_delete.fish | 3 - functions/__fisher_key_bindings_disable.fish | 12 - functions/__fisher_key_bindings_enable.fish | 19 - functions/__fisher_key_bindings_reset.fish | 6 - functions/__fisher_key_bindings_undo.fish | 3 - functions/__fisher_key_bindings_update.fish | 28 - .../__fisher_key_bindings_update_user.fish | 10 - functions/__fisher_list.fish | 3 - functions/__fisher_name.fish | 6 - functions/__fisher_path_from_plugin.fish | 16 - functions/__fisher_path_from_url.fish | 16 - functions/__fisher_path_is_prompt.fish | 5 - functions/__fisher_path_update.fish | 19 - functions/__fisher_plugin_can_enable.fish | 7 - functions/__fisher_plugin_disable.fish | 41 - functions/__fisher_plugin_enable.fish | 60 - functions/__fisher_plugin_fetch.fish | 136 -- functions/__fisher_plugin_from_path.fish | 11 - functions/__fisher_plugin_link.fish | 4 - functions/__fisher_plugin_source.fish | 3 - .../__fisher_plugin_uninstall_handler.fish | 8 - functions/__fisher_plugin_unlink.fish | 9 - functions/__fisher_plugin_validate.fish | 56 - functions/__fisher_plugin_walk.fish | 60 - functions/__fisher_prompt_reset.fish | 14 - functions/__fisher_string_escape.fish | 3 - functions/__fisher_url_clone.fish | 4 - functions/__fisher_url_from_path.fish | 27 - functions/__fisher_xdg.fish | 25 - functions/debug.fish | 2 - functions/fish_config.fish | 24 - functions/fisher.fish | 69 - functions/fisher_help.fish | 46 - functions/fisher_install.fish | 71 - functions/fisher_list.fish | 58 - functions/fisher_search.fish | 279 --- functions/fisher_uninstall.fish | 112 - functions/fisher_update.fish | 157 -- functions/getopts.fish | 30 - functions/man.fish | 4 - functions/spin.fish | 73 - man/man1/fisher-help.1 | 52 - man/man1/fisher-help.md | 37 - man/man1/fisher-install.1 | 157 -- man/man1/fisher-install.md | 97 - man/man1/fisher-list.1 | 78 - man/man1/fisher-list.md | 44 - man/man1/fisher-search.1 | 226 -- man/man1/fisher-search.md | 128 -- man/man1/fisher-tutorial.1 | 1 - man/man1/fisher-uninstall.1 | 75 - man/man1/fisher-uninstall.md | 45 - man/man1/fisher-update.1 | 72 - man/man1/fisher-update.md | 39 - man/man1/fisher.1 | 727 ------- man/man1/fisher.md | 435 ---- man/man1/fisherman.1 | 1 - man/man1/getopts.1 | 69 - man/man1/getopts.md | 42 - man/man1/spin.1 | 60 - man/man1/spin.md | 43 - test/cache-list.fish | 24 - test/complete-reset.fish | 25 - test/complete.fish | 27 - test/config-color-reset.fish | 3 - test/config-color-save.fish | 24 - test/config.fish | 43 - test/file-contains.fish | 7 - test/file-remove.fish | 17 - test/file.fish | 14 - test/fisher.fish | 45 +- test/fixtures/gist/foo.json | 46 - .../key-bindings/expected/key_bindings | 4 - .../key-bindings/expected/key_bindings_log | 2 - .../key-bindings/fisher_key_bindings.fish | 6 - .../update/fish_user_key_bindings_bottom.fish | 5 - .../update/fish_user_key_bindings_empty.fish | 2 - .../fish_user_key_bindings_function.fish | 5 - .../update/key_bindings_file.fish | 3 - .../update/key_bindings_function.fish | 9 - .../key-bindings/user_key_bindings.fish | 7 - test/fixtures/manifest/fishfile | 41 - test/fixtures/manifest/fishfile-no-comments | 11 - test/fixtures/manifest/fishfile-parsed | 11 - test/fixtures/path-walk/foobar-path-walk | 32 - test/fixtures/path-walk/foobar-source-files | 33 - test/fixtures/plugins/bar/bar.fish | 3 - test/fixtures/plugins/baz/baz.fish | 3 - test/fixtures/plugins/foo/foo.fish | 3 - test/fixtures/plugins/foobar/LICENSE | 0 test/fixtures/plugins/foobar/README.md | 0 test/fixtures/plugins/foobar/before.init.fish | 0 .../plugins/foobar/completions/foobar.fish | 0 test/fixtures/plugins/foobar/conf.d/conf.fish | 0 test/fixtures/plugins/foobar/config.fish | 0 .../plugins/foobar/fish_greeting.fish | 0 test/fixtures/plugins/foobar/fish_prompt.fish | 0 .../plugins/foobar/fish_right_prompt.fish | 0 test/fixtures/plugins/foobar/fish_title.fish | 0 .../foobar/fish_user_key_bindings.fish | 0 test/fixtures/plugins/foobar/foobar.fish | 0 test/fixtures/plugins/foobar/foobar.load | 0 .../plugins/foobar/functions/foobar-baz.fish | 0 .../plugins/foobar/functions/foobar.awk | 0 .../plugins/foobar/functions/foobar.php | 0 .../plugins/foobar/functions/foobar.pl | 0 .../plugins/foobar/functions/foobar.py | 0 .../plugins/foobar/functions/foobar.rb | 0 .../plugins/foobar/functions/foobar.sed | 0 .../foobar/functions/lib/__foobar.fish | 0 test/fixtures/plugins/foobar/init.fish | 0 .../fixtures/plugins/foobar/man/man1/foobar.1 | 0 .../fixtures/plugins/foobar/man/man2/foobar.2 | 0 .../fixtures/plugins/foobar/man/man3/foobar.3 | 0 .../fixtures/plugins/foobar/man/man4/foobar.4 | 0 .../fixtures/plugins/foobar/man/man5/foobar.5 | 0 .../fixtures/plugins/foobar/man/man6/foobar.6 | 0 .../fixtures/plugins/foobar/man/man7/foobar.7 | 0 .../fixtures/plugins/foobar/man/man8/foobar.8 | 0 .../fixtures/plugins/foobar/man/man9/foobar.9 | 0 test/fixtures/plugins/foobar/modules/mod.fish | 0 test/fixtures/plugins/foobar/quux.awk | 0 test/fixtures/plugins/foobar/scripts/norf.py | 0 test/fixtures/plugins/foobar/uninstall.fish | 0 test/fixtures/plugins/index | 23 - test/getopts.fish | 112 - test/gist-to-name.fish | 26 - test/help-parse.fish | 24 - test/help.fish | 28 - test/helpers/config-mock-teardown.fish | 1 - test/helpers/config-mock.fish | 23 - test/helpers/git-ls-remote.fish | 14 - test/index-update.fish | 24 - test/install.fish | 44 - test/key-bindings-delete.fish | 10 - test/key-bindings-disable.fish | 34 - test/key-bindings-enable.fish | 24 - test/key-bindings-reset.fish | 27 - test/key-bindings-undo.fish | 11 - test/key-bindings-update-user.fish | 15 - test/key-bindings-update.fish | 19 - test/key-bindings.fish | 17 - test/list-fishfile.fish | 9 - test/list.fish | 48 - test/name.fish | 86 - test/path-from-plugin.fish | 35 - test/path-from-url.fish | 37 - test/path-is-prompt.fish | 34 - test/plugin-can-enable.fish | 24 - test/plugin-from-path.fish | 21 - test/plugin-link.fish | 13 - test/plugin-source.fish | 14 - test/plugin-uninstall-handler.fish | 29 - test/plugin-unlink.fish | 22 - test/plugin-walk-conf.d.fish | 18 - test/plugin-walk-functions.fish | 32 - test/plugin-walk-init-files.fish | 36 - test/plugin-walk-prompt.fish | 33 - test/plugin-walk-uninstall.fish | 21 - test/plugin-walk.fish | 127 -- test/prompt-reset.fish | 103 - test/search.fish | 98 - test/spin.fish | 22 - test/string-escape.fish | 6 - test/uninstall.fish | 46 - test/url-clone.fish | 18 - test/url-from-path-git.fish | 33 - test/url-from-path-links.fish | 14 - test/validate-name.fish | 41 - test/validate-path.fish | 47 - test/validate-url.fish | 41 - test/xdg.fish | 30 - 206 files changed, 2393 insertions(+), 7462 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .gitignore delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 THANKS.md delete mode 100644 VERSION delete mode 100755 bin/install delete mode 100644 completions/fisher.fish delete mode 100644 completions/getopts.fish delete mode 100644 completions/spin.fish delete mode 100644 config.fish create mode 100644 docs/.DS_Store create mode 100644 docs/es-ES/README.md create mode 100644 docs/jp-JA/README.md create mode 100644 fisher.fish delete mode 100644 functions/__fisher_cache_list.fish delete mode 100644 functions/__fisher_complete.fish delete mode 100644 functions/__fisher_complete_reset.fish delete mode 100644 functions/__fisher_config_color_reset.fish delete mode 100644 functions/__fisher_config_color_save.fish delete mode 100644 functions/__fisher_file.fish delete mode 100644 functions/__fisher_file_contains.fish delete mode 100644 functions/__fisher_file_remove.fish delete mode 100644 functions/__fisher_gist_to_name.fish delete mode 100644 functions/__fisher_help_commands.fish delete mode 100644 functions/__fisher_help_parse.fish delete mode 100644 functions/__fisher_help_usage.fish delete mode 100644 functions/__fisher_index_update.fish delete mode 100644 functions/__fisher_key_bindings.fish delete mode 100644 functions/__fisher_key_bindings_delete.fish delete mode 100644 functions/__fisher_key_bindings_disable.fish delete mode 100644 functions/__fisher_key_bindings_enable.fish delete mode 100644 functions/__fisher_key_bindings_reset.fish delete mode 100644 functions/__fisher_key_bindings_undo.fish delete mode 100644 functions/__fisher_key_bindings_update.fish delete mode 100644 functions/__fisher_key_bindings_update_user.fish delete mode 100644 functions/__fisher_list.fish delete mode 100644 functions/__fisher_name.fish delete mode 100644 functions/__fisher_path_from_plugin.fish delete mode 100644 functions/__fisher_path_from_url.fish delete mode 100644 functions/__fisher_path_is_prompt.fish delete mode 100644 functions/__fisher_path_update.fish delete mode 100644 functions/__fisher_plugin_can_enable.fish delete mode 100644 functions/__fisher_plugin_disable.fish delete mode 100644 functions/__fisher_plugin_enable.fish delete mode 100644 functions/__fisher_plugin_fetch.fish delete mode 100644 functions/__fisher_plugin_from_path.fish delete mode 100644 functions/__fisher_plugin_link.fish delete mode 100644 functions/__fisher_plugin_source.fish delete mode 100644 functions/__fisher_plugin_uninstall_handler.fish delete mode 100644 functions/__fisher_plugin_unlink.fish delete mode 100644 functions/__fisher_plugin_validate.fish delete mode 100644 functions/__fisher_plugin_walk.fish delete mode 100644 functions/__fisher_prompt_reset.fish delete mode 100644 functions/__fisher_string_escape.fish delete mode 100644 functions/__fisher_url_clone.fish delete mode 100644 functions/__fisher_url_from_path.fish delete mode 100644 functions/__fisher_xdg.fish delete mode 100644 functions/debug.fish delete mode 100644 functions/fish_config.fish delete mode 100644 functions/fisher.fish delete mode 100644 functions/fisher_help.fish delete mode 100644 functions/fisher_install.fish delete mode 100644 functions/fisher_list.fish delete mode 100644 functions/fisher_search.fish delete mode 100644 functions/fisher_uninstall.fish delete mode 100644 functions/fisher_update.fish delete mode 100644 functions/getopts.fish delete mode 100644 functions/man.fish delete mode 100644 functions/spin.fish delete mode 100644 man/man1/fisher-help.1 delete mode 100644 man/man1/fisher-help.md delete mode 100644 man/man1/fisher-install.1 delete mode 100644 man/man1/fisher-install.md delete mode 100644 man/man1/fisher-list.1 delete mode 100644 man/man1/fisher-list.md delete mode 100644 man/man1/fisher-search.1 delete mode 100644 man/man1/fisher-search.md delete mode 120000 man/man1/fisher-tutorial.1 delete mode 100644 man/man1/fisher-uninstall.1 delete mode 100644 man/man1/fisher-uninstall.md delete mode 100644 man/man1/fisher-update.1 delete mode 100644 man/man1/fisher-update.md delete mode 100644 man/man1/fisher.1 delete mode 100644 man/man1/fisher.md delete mode 120000 man/man1/fisherman.1 delete mode 100644 man/man1/getopts.1 delete mode 100644 man/man1/getopts.md delete mode 100644 man/man1/spin.1 delete mode 100644 man/man1/spin.md delete mode 100644 test/cache-list.fish delete mode 100644 test/complete-reset.fish delete mode 100644 test/complete.fish delete mode 100644 test/config-color-reset.fish delete mode 100644 test/config-color-save.fish delete mode 100644 test/config.fish delete mode 100644 test/file-contains.fish delete mode 100644 test/file-remove.fish delete mode 100644 test/file.fish delete mode 100644 test/fixtures/gist/foo.json delete mode 100644 test/fixtures/key-bindings/expected/key_bindings delete mode 100644 test/fixtures/key-bindings/expected/key_bindings_log delete mode 100644 test/fixtures/key-bindings/fisher_key_bindings.fish delete mode 100644 test/fixtures/key-bindings/update/fish_user_key_bindings_bottom.fish delete mode 100644 test/fixtures/key-bindings/update/fish_user_key_bindings_empty.fish delete mode 100644 test/fixtures/key-bindings/update/fish_user_key_bindings_function.fish delete mode 100644 test/fixtures/key-bindings/update/key_bindings_file.fish delete mode 100644 test/fixtures/key-bindings/update/key_bindings_function.fish delete mode 100644 test/fixtures/key-bindings/user_key_bindings.fish delete mode 100644 test/fixtures/manifest/fishfile delete mode 100644 test/fixtures/manifest/fishfile-no-comments delete mode 100644 test/fixtures/manifest/fishfile-parsed delete mode 100644 test/fixtures/path-walk/foobar-path-walk delete mode 100644 test/fixtures/path-walk/foobar-source-files delete mode 100644 test/fixtures/plugins/bar/bar.fish delete mode 100644 test/fixtures/plugins/baz/baz.fish delete mode 100644 test/fixtures/plugins/foo/foo.fish delete mode 100644 test/fixtures/plugins/foobar/LICENSE delete mode 100644 test/fixtures/plugins/foobar/README.md delete mode 100644 test/fixtures/plugins/foobar/before.init.fish delete mode 100644 test/fixtures/plugins/foobar/completions/foobar.fish delete mode 100644 test/fixtures/plugins/foobar/conf.d/conf.fish delete mode 100644 test/fixtures/plugins/foobar/config.fish delete mode 100644 test/fixtures/plugins/foobar/fish_greeting.fish delete mode 100644 test/fixtures/plugins/foobar/fish_prompt.fish delete mode 100644 test/fixtures/plugins/foobar/fish_right_prompt.fish delete mode 100644 test/fixtures/plugins/foobar/fish_title.fish delete mode 100644 test/fixtures/plugins/foobar/fish_user_key_bindings.fish delete mode 100644 test/fixtures/plugins/foobar/foobar.fish delete mode 100644 test/fixtures/plugins/foobar/foobar.load delete mode 100644 test/fixtures/plugins/foobar/functions/foobar-baz.fish delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.awk delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.php delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.pl delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.py delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.rb delete mode 100644 test/fixtures/plugins/foobar/functions/foobar.sed delete mode 100644 test/fixtures/plugins/foobar/functions/lib/__foobar.fish delete mode 100644 test/fixtures/plugins/foobar/init.fish delete mode 100644 test/fixtures/plugins/foobar/man/man1/foobar.1 delete mode 100644 test/fixtures/plugins/foobar/man/man2/foobar.2 delete mode 100644 test/fixtures/plugins/foobar/man/man3/foobar.3 delete mode 100644 test/fixtures/plugins/foobar/man/man4/foobar.4 delete mode 100644 test/fixtures/plugins/foobar/man/man5/foobar.5 delete mode 100644 test/fixtures/plugins/foobar/man/man6/foobar.6 delete mode 100644 test/fixtures/plugins/foobar/man/man7/foobar.7 delete mode 100644 test/fixtures/plugins/foobar/man/man8/foobar.8 delete mode 100644 test/fixtures/plugins/foobar/man/man9/foobar.9 delete mode 100644 test/fixtures/plugins/foobar/modules/mod.fish delete mode 100644 test/fixtures/plugins/foobar/quux.awk delete mode 100644 test/fixtures/plugins/foobar/scripts/norf.py delete mode 100644 test/fixtures/plugins/foobar/uninstall.fish delete mode 100644 test/fixtures/plugins/index delete mode 100644 test/getopts.fish delete mode 100644 test/gist-to-name.fish delete mode 100644 test/help-parse.fish delete mode 100644 test/help.fish delete mode 100644 test/helpers/config-mock-teardown.fish delete mode 100644 test/helpers/config-mock.fish delete mode 100644 test/helpers/git-ls-remote.fish delete mode 100644 test/index-update.fish delete mode 100644 test/install.fish delete mode 100644 test/key-bindings-delete.fish delete mode 100644 test/key-bindings-disable.fish delete mode 100644 test/key-bindings-enable.fish delete mode 100644 test/key-bindings-reset.fish delete mode 100644 test/key-bindings-undo.fish delete mode 100644 test/key-bindings-update-user.fish delete mode 100644 test/key-bindings-update.fish delete mode 100644 test/key-bindings.fish delete mode 100644 test/list-fishfile.fish delete mode 100644 test/list.fish delete mode 100644 test/name.fish delete mode 100644 test/path-from-plugin.fish delete mode 100644 test/path-from-url.fish delete mode 100644 test/path-is-prompt.fish delete mode 100644 test/plugin-can-enable.fish delete mode 100644 test/plugin-from-path.fish delete mode 100644 test/plugin-link.fish delete mode 100644 test/plugin-source.fish delete mode 100644 test/plugin-uninstall-handler.fish delete mode 100644 test/plugin-unlink.fish delete mode 100644 test/plugin-walk-conf.d.fish delete mode 100644 test/plugin-walk-functions.fish delete mode 100644 test/plugin-walk-init-files.fish delete mode 100644 test/plugin-walk-prompt.fish delete mode 100644 test/plugin-walk-uninstall.fish delete mode 100644 test/plugin-walk.fish delete mode 100644 test/prompt-reset.fish delete mode 100644 test/search.fish delete mode 100644 test/spin.fish delete mode 100644 test/string-escape.fish delete mode 100644 test/uninstall.fish delete mode 100644 test/url-clone.fish delete mode 100644 test/url-from-path-git.fish delete mode 100644 test/url-from-path-links.fish delete mode 100644 test/validate-name.fish delete mode 100644 test/validate-path.fish delete mode 100644 test/validate-url.fish delete mode 100644 test/xdg.fish diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 79a5fca..0000000 --- a/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true -[*] -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e43b0f9..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store diff --git a/.travis.yml b/.travis.yml index b68f4d7..1c567cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 08a8aa5..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -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 or fisher --list=. - - > 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[==] 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/` 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. - - - -[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 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index ced6990..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -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 - -[Contributor Covenant]: http://contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index efcf8a5..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -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 diff --git a/LICENSE b/LICENSE index 1a6e9b2..5496a42 100644 --- a/LICENSE +++ b/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. +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. diff --git a/README.md b/README.md index 224d4c0..2abcf91 100644 --- a/README.md +++ b/README.md @@ -1,258 +1,259 @@ -

- English • - 简体中文 -

- - -[![play]][play-link] -

-
-
- 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 [![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 diff --git a/THANKS.md b/THANKS.md deleted file mode 100644 index 0aa94c0..0000000 --- a/THANKS.md +++ /dev/null @@ -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) diff --git a/VERSION b/VERSION deleted file mode 100644 index bc80560..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.5.0 diff --git a/bin/install b/bin/install deleted file mode 100755 index b09e551..0000000 --- a/bin/install +++ /dev/null @@ -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 diff --git a/completions/fisher.fish b/completions/fisher.fish deleted file mode 100644 index a40630a..0000000 --- a/completions/fisher.fish +++ /dev/null @@ -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 diff --git a/completions/getopts.fish b/completions/getopts.fish deleted file mode 100644 index ce14c24..0000000 --- a/completions/getopts.fish +++ /dev/null @@ -1 +0,0 @@ -complete -xc getopts -a '\t' diff --git a/completions/spin.fish b/completions/spin.fish deleted file mode 100644 index c150f4a..0000000 --- a/completions/spin.fish +++ /dev/null @@ -1,2 +0,0 @@ -set -l IFS \t -spin -h | __fisher_complete spin diff --git a/config.fish b/config.fish deleted file mode 100644 index 8b4ee29..0000000 --- a/config.fish +++ /dev/null @@ -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 diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f943ca9c5434b325f85a0627be4ccb17040a189a GIT binary patch literal 6148 zcmeH~IS#@=3`K3AK%z-WISmKk1|tL~-~w!-Vkr>)9G&l_AyA_TeM|NmdtxQ|MJ5&z zT|G}rkxoRWaHA|N^h}YD zw}U0GtH~COcF`O@H1Di7#lSS$MGF#`RtEzWpaMMw#*ue+{%_#l=Ko#`Qz}3O{!9U# zthehGUMkPlkJq#ME~~a~aL_MDc>4)JVn^{D?uPwh3$P|z5EU4I1Y8CND)3VUUZ@xm AY5)KL literal 0 HcmV?d00001 diff --git a/docs/es-ES/README.md b/docs/es-ES/README.md new file mode 100644 index 0000000..ef2f9f4 --- /dev/null +++ b/docs/es-ES/README.md @@ -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 diff --git a/docs/jp-JA/README.md b/docs/jp-JA/README.md new file mode 100644 index 0000000..9d84772 --- /dev/null +++ b/docs/jp-JA/README.md @@ -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 diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index eec0621..48d5502 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -1,254 +1,18 @@ -

- English • - 简体中文 -

- - -[![play]][play-link] -

-
-
- fisherman -
-
-
-

- -[![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 diff --git a/fisher.fish b/fisher.fish new file mode 100644 index 0000000..7a17c1e --- /dev/null +++ b/fisher.fish @@ -0,0 +1,1895 @@ +function fisher + set -g fisher_version "2.0.0-beta" + set -g fisher_spinners ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ + + function __fisher_show_spinner + if not set -q __fisher_fg_spinner[1] + set -g __fisher_fg_spinner $fisher_spinners + end + + printf " $__fisher_fg_spinner[1]\r" > /dev/stderr + + set -e __fisher_fg_spinner[1] + end + + set -l config_home $XDG_CONFIG_HOME + set -l cache_home $XDG_CACHE_HOME + + if test -z "$config_home" + set config_home ~/.config + end + + if test -z "$cache_home" + set cache_home ~/.cache + end + + if test -z "$fish_config" + set -g fish_config "$config_home/fish" + end + + if test -z "$fisher_config" + set -g fisher_config "$config_home/fisherman" + end + + if test -z "$fisher_cache" + set -g fisher_cache "$cache_home/fisherman" + end + + if test -z "$fisher_bundle" + set -g fisher_bundle "$fish_config/fishfile" + end + + if not command mkdir -p "$fish_config/"{conf.d,functions,completions} "$fisher_config" "$fisher_cache" + __fisher_log error " + I couldn't create the fisherman configuration. + You need write permissions in these directories: + + $fish_config + $fisher_config + $fisher_cache + " > /dev/stderr + + return 1 + end + + set -g __fisher_stdout /dev/stdout + set -g __fisher_stderr /dev/stderr + + for i in -q --quiet + if set -l index (builtin contains --index -- $i $argv) + set -e argv[$index] + set __fisher_stdout /dev/null + set __fisher_stderr /dev/null + + break + end + end + + set -l cmd + + switch "$argv[1]" + case i install + set -e argv[1] + set cmd "install" + + case u up update + set -e argv[1] + set cmd "update" + + case r rm remove uninstall + set -e argv[1] + set cmd "rm" + + case l ls list + set -e argv[1] + set cmd "ls" + + case h help + set -e argv[1] + __fisher_help $argv + + case --help + set -e argv[1] + __fisher_help + + case -h + __fisher_usage > /dev/stderr + + case -v --version + set -l home ~ + printf "fisherman version $fisher_version %s\n" (__fisher_plugin_normalize_path (status -f) | command awk -v home="$home" '{ sub(home, "~") } //') + return + + case -- "" + set -e argv[1] + + if test -z "$argv" + set cmd "default" + else + set cmd "install" + end + + case self-uninstall + set -e argv[1] + __fisher_self_uninstall $argv + return + + case -\*\? + printf "fisher: '%s' is not a valid option\n" "$argv[1]" > /dev/stderr + __fisher_usage > /dev/stderr + return 1 + + case \* + set cmd "install" + end + + set -l elapsed (__fisher_get_epoch_in_ms) + + set -l items ( + if test ! -z "$argv" + printf "%s\n" $argv | command awk ' + + /^(--|-).*/ { next } + + /^omf\// { + sub(/^omf\//, "oh-my-fish/") + + if ($0 !~ /(theme|plugin)-/) { + sub(/^oh-my-fish\//, "oh-my-fish/plugin-") + } + } + + !seen[$0]++ + + ' + end + ) + + if test -z "$items" -a "$cmd" = "default" + if isatty + touch "$fisher_bundle" + + set items (__fisher_read_bundle_file < "$fisher_bundle") + set cmd "install" + + if test -z "$items" + __fisher_usage > /dev/stderr + return + end + end + end + + switch "$cmd" + case install + if __fisher_install $items + __fisher_log okay "Done in "(__fisher_get_epoch_in_ms $elapsed | __fisher_humanize_duration) $__fisher_stderr + end + + case update + if isatty + if test -z "$items" + __fisher_self_update + + set items (__fisher_list | command sed 's/^[@* ]*//') + end + else + __fisher_parse_column_output | __fisher_read_bundle_file | read -laz _items + set items $items $_items + end + + __fisher_update $items + + __fisher_log okay "Done in "(__fisher_get_epoch_in_ms $elapsed | __fisher_humanize_duration) $__fisher_stderr + + case ls + if test "$argv" -ge 0 -o "$argv" = - + set items (__fisher_list) + + set -l count (count $items) + + if test "$count" -ge 10 + printf "%s\n" $items | column -c$argv + + else if test "$count" -ge 1 + printf "%s\n" $items + end + + else + __fisher_list_plugin_directory $argv + end + + case rm + if test -z "$items" + __fisher_parse_column_output | __fisher_read_bundle_file | read -az items + end + + if test (count $items) -le 1 + function __fisher_show_spinner + end + end + + if test ! -z "$items" + for i in $items + set -l name (__fisher_plugin_get_names "$i")[1] + __fisher_plugin_disable "$fisher_config/$name" + __fisher_show_spinner + end + + __fisher_log okay "Done in "(__fisher_get_epoch_in_ms $elapsed | __fisher_humanize_duration) $__fisher_stderr + end + end + + complete -c fisher --erase + + set -l config $fisher_config/* + set -l cache $fisher_cache/* + + if test -z "$config" + echo > $fisher_bundle + else + __fisher_plugin_get_url_info -- $config > $fisher_bundle + + complete -xc fisher -n "__fish_seen_subcommand_from u up update r rm remove uninstall" -a "(printf '%s\n' $config | command sed 's|.*/||')" + complete -xc fisher -n "__fish_seen_subcommand_from u up update r rm remove uninstall" -a "$fisher_active_prompt" -d "Prompt" + end + + if test ! -z "$cache" + printf "%s\n" $cache | command awk -v _config="$config" ' + + BEGIN { + count = split(_config, config, " ") + } + + { + sub(/.*\//, "") + + for (i = 1; i <= count; i++) { + sub(/.*\//, "", config[i]) + + if (config[i] == $0) { + next + } + } + } + + // + + ' | while read -l plugin + if __fisher_plugin_is_prompt "$fisher_cache/$plugin" + complete -xc fisher -n "__fish_seen_subcommand_from i in install" -a "$plugin" -d "Prompt" + complete -xc fisher -n "not __fish_seen_subcommand_from u up update r rm remove uninstall l ls list h help" -a "$plugin" -d "Prompt" + else + complete -xc fisher -n "__fish_seen_subcommand_from i in install" -a "$plugin" -d "Plugin" + complete -xc fisher -n "not __fish_seen_subcommand_from u up update r rm remove uninstall l ls list h help" -a "$plugin" -d "Plugin" + end + end + end + + set -l completions "$fish_config/completions/fisher.fish" + + if test ! -e "$completions" + __fisher_completions_write > "$completions" + source "$completions" + end +end + +function __fisher_install + if test -z "$argv" + __fisher_read_bundle_file | read -az argv + end + + set -e __fisher_fetch_plugins_state + + if set -l fetched (__fisher_plugin_fetch_items (__fisher_plugin_get_missing $argv)) + if test -z "$fetched" + set -l count (count $argv) + + __fisher_log okay " + No plugins to install or dependencies missing. + " $__fisher_stderr + + return 1 + end + + for i in $fetched + __fisher_plugin_enable "$fisher_config/$i" + end + + else + __fisher_log error " + There was an error cloning @$fetched@ or more plugin/s. + " $__fisher_stderr + + __fisher_log info " + Try using a namespace before the plugin name: @omf@/$fetched + " $__fisher_stderr + + return 1 + end +end + + +function __fisher_plugin_fetch_items + __fisher_show_spinner + + set -l jobs + set -l links + set -l white + set -l count (count $argv) + + if test "$count" -eq 0 + return + end + + switch "$__fisher_fetch_plugins_state" + case "" + if test "$count" = 1 -a -d "$argv[1]" + if test "$argv[1]" = "$PWD" + set -l home ~ + set -l name (printf "%s\n" "$argv[1]" | sed "s|$home|~|") + + __fisher_log info "Installing @""$name""@ " $__fisher_stderr + else + set -l name (printf "%s\n" "$argv[1]" | sed "s|$PWD/||") + + __fisher_log info "Installing @""$name""@ " $__fisher_stderr + end + else + __fisher_log info "Installing @$count@ plugin/s" $__fisher_stderr + end + + set -g __fisher_fetch_plugins_state "fetching" + + case "fetching" + __fisher_log info "Installing @$count@ dependencies" $__fisher_stderr + set -g __fisher_fetch_plugins_state "done" + + case "done" + end + + for i in $argv + set -l names + + switch "$i" + case \*gist.github.com\* + __fisher_log okay "Resolving gist name." + if not set names (__fisher_get_plugin_name_from_gist "$i") "" + __fisher_log error " + I couldn't clone your gist: + @$i@ + " + continue + end + + case \* + set names (__fisher_plugin_get_names "$i") + end + + if test -d "$i" + command ln -sfF "$i" "$fisher_config/$names[1]" + set links $links "$names[1]" + continue + end + + set -l source "$fisher_cache/$names[1]" + + if test -z "$names[2]" + if test -d "$source" + if test -L "$source" + command ln -sfF "$source" "$fisher_config" + else + command cp -rf "$source" "$fisher_config" + end + else + set jobs $jobs (__fisher_plugin_url_clone_async "$i" "$names[1]") + end + else + if test -d "$source" + set -l real_namespace (__fisher_plugin_get_url_info --dirname "$source" ) + + if test "$real_namespace" = "$names[2]" + command cp -rf "$source" "$fisher_config" + else + set jobs $jobs (__fisher_plugin_url_clone_async "$i" "$names[1]") + end + else + set jobs $jobs (__fisher_plugin_url_clone_async "$i" "$names[1]") + end + end + + set fetched $fetched "$names[1]" + end + + __fisher_jobs_await $jobs + + for i in $fetched + if test ! -d "$fisher_cache/$i" + printf "%s\n" "$i" + return 1 + end + end + + if test ! -z "$fetched" + __fisher_plugin_fetch_items (__fisher_plugin_get_missing $fetched) + printf "%s\n" $fetched + end + + if test ! -z "$links" + __fisher_plugin_fetch_items (__fisher_plugin_get_missing $links) + printf "%s\n" $links + end +end + + +function __fisher_plugin_url_clone_async -a url name + switch "$url" + case https://\* + case github.com/\* + set url "https://$url" + + case \?\*/\?\* + set url "https://github.com/$url" + + case \* + set url "https://github.com/fisherman/$url" + end + + set -l nc (set_color normal) + set -l error (set_color red) + set -l okay (set_color green) + + set -l hm_url (printf "%s\n" "$url" | sed 's|^https://||') + + fish -c " + set -lx GIT_ASKPASS /bin/echo + + if command git clone -q --depth 1 '$url' '$fisher_cache/$name' ^ /dev/null + printf '$okay""OKAY""$nc Fetching $okay%s$nc %s\n' '$name' '→ $hm_url' + command cp -rf '$fisher_cache/$name' '$fisher_config' + else + printf '$error""ARGH""$nc Fetching $error%s$nc %s\n' '$name' '→ $hm_url' + end + " > /dev/stderr & + + __fisher_jobs_get -l +end + + +function __fisher_update + set -l jobs + set -l count (count $argv) + set -l updated + set -l skipped 0 + + if test "$count" = 0 + return + end + + if test "$count" -eq 1 + __fisher_log info "Updating @$count@ plugin" $__fisher_stderr + else + __fisher_log info "Updating @$count@ plugins" $__fisher_stderr + end + + for i in $argv + set -l path "$fisher_config/$i" + + if test -d "$path" + set updated $updated "$i" + + if test -L "$fisher_config/$i" + set skipped (math "$skipped + 1") + continue + end + + set jobs $jobs (__fisher_update_path_async "$i" "$path") + else + __fisher_log warn "@$i@ is not installed" + end + end + + __fisher_jobs_await $jobs + + set -g __fisher_fetch_plugins_state "fetching" + set -l fetched (__fisher_plugin_fetch_items (__fisher_plugin_get_missing $updated)) + + for i in $updated $fetched + if test "$i" = "$fisher_active_prompt" + set fisher_active_prompt + end + __fisher_plugin_enable "$fisher_config/$i" + end + + if test "$skipped" -gt 0 + __fisher_log warn "Skipped @$skipped@ symlink/s" $__fisher_stderr + end +end + + +function __fisher_self_update + set -l raw_url "https://raw.githubusercontent.com/fisherman/fisherman/master/fisher.fish" + set -l fake_qs (date "+%s") + set -l file (status --current-filename) + + if test "$file" != "$fish_config/functions/fisher.fish" + __fisher_log warn " + Non-standard setup detected. + " $__fisher_stderr + + return 1 + end + + set -l previous_version "$fisher_version" + + fish -c "curl --max-time 5 -sS '$raw_url?$fake_qs' > $file.$fake_qs" & + + __fisher_jobs_await (__fisher_jobs_get -l) + + if test -s "$file.$fake_qs" + command mv "$file.$fake_qs" "$file" + end + + source "$file" + fisher -v > /dev/null + set -l new_version "$fisher_version" + + if test "$previous_version" = "$fisher_version" + __fisher_log okay "@fisherman is up to date@" $__fisher_stderr + else + __fisher_log okay "You are now running fisherman @$fisher_version@" $__fisher_stderr + + __fisher_log info " + + To see the change log, please visit: + __https://github.com/fisherman/fisherman/releases__ + " $__fisher_stderr + end +end + + +function __fisher_update_path_async -a name path + set -l nc (set_color normal) + set -l error (set_color red) + set -l uline (set_color -u) + set -l okay (set_color green) + + fish -c " + + pushd $path + + if not command git fetch -q origin master ^ /dev/null + printf '$error""ARGH""$nc Fetching $error%s$nc\n' '$name' + exit + end + + set -l commits (command git rev-list --left-right --count master..FETCH_HEAD ^ /dev/null | cut -d\t -f2) + + command git reset -q --hard FETCH_HEAD ^ /dev/null + command git clean -qdfx + + if test -z \"\$commits\" -o \"\$commits\" -eq 0 + printf '$okay""OKAY""$nc Latest $okay%s$nc\n' '$name' + command cp -rf '$path' '$fisher_cache/$name' + else + printf '$okay""OKAY""$nc $okay%s$nc new commits $okay%s$nc\n' \$commits '$name' + end + + " > /dev/stderr & + + __fisher_jobs_get -l +end + + +function __fisher_plugin_enable -a path + if __fisher_plugin_is_prompt "$path" + if test ! -z "$fisher_active_prompt" + __fisher_plugin_disable "$fisher_config/$fisher_active_prompt" + end + + set -U fisher_active_prompt (basename "$path") + end + + set -l plugin_name (basename $path) + + for file in $path/{functions/*,}*.fish + set -l base (basename "$file") + + if test "$base" = "uninstall.fish" + continue + end + + switch "$base" + case {,fish_}key_bindings.fish + __fisher_key_bindings_append "$plugin_name" "$file" + continue + end + + set -l dir "functions" + + if test "$base" = "init.fish" + set dir "conf.d" + + set base "$plugin_name.$base" + end + + set -l target "$fish_config/$dir/$base" + + command ln -sfF "$file" "$target" + builtin source "$target" + + if test "$base" = "set_color_custom.fish" + 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" > "$fish_config/fish_colors" + set_color_custom + end + end + + for file in $path/conf.d/*.{py,awk} + set -l base (basename "$file") + command ln -sfF "$file" "$fish_config/conf.d/$base" + end + + for file in $path/{functions/,}*.{py,awk} + set -l base (basename "$file") + command ln -sfF "$file" "$fish_config/functions/$base" + end + + for file in $path/conf.d/*.fish + set -l base (basename "$file") + set -l target "$fish_config/conf.d/$base" + + command ln -sfF "$file" "$target" + builtin source "$target" + end + + for file in $path/completions/*.fish + set -l base (basename "$file") + set -l target "$fish_config/completions/$base" + + command ln -sfF "$file" "$target" + builtin source "$target" + end + + return 0 +end + + +function __fisher_plugin_disable -a path + set -l plugin_name (basename $path) + + for file in $path/{functions/*,}*.fish + set -l name (basename "$file" .fish) + set -l base "$name.fish" + + if test "$base" = "uninstall.fish" + builtin source "$file" + continue + end + + switch "$base" + case {,fish_}key_bindings.fish + __fisher_key_bindings_remove "$plugin_name" + continue + end + + set -l dir "functions" + + if test "$base" = "init.fish" + set dir "conf.d" + set base "$plugin_name.$base" + end + + command rm -f "$fish_config/$dir/$base" + + functions -e "$name" + + if test "$base" = "set_color_custom.fish" + set -l fish_colors_config "$fish_config/fish_colors" + + if test ! -f "$fish_colors_config" + __fisher_reset_default_fish_colors + continue + end + + set -l IFS \n + + read -laz colors < $fish_colors_config + set colors[25] "" + + set -l IFS " " + + echo "$colors[1]" | read -a -U fish_color_normal + echo "$colors[2]" | read -a -U fish_color_command + echo "$colors[3]" | read -a -U fish_color_param + echo "$colors[4]" | read -a -U fish_color_redirection + echo "$colors[5]" | read -a -U fish_color_comment + echo "$colors[6]" | read -a -U fish_color_error + echo "$colors[7]" | read -a -U fish_color_escape + echo "$colors[8]" | read -a -U fish_color_operator + echo "$colors[9]" | read -a -U fish_color_end + echo "$colors[10]" | read -a -U fish_color_quote + echo "$colors[11]" | read -a -U fish_color_autosuggestion + echo "$colors[12]" | read -a -U fish_color_user + echo "$colors[13]" | read -a -U fish_color_valid_path + echo "$colors[14]" | read -a -U fish_color_cwd + echo "$colors[15]" | read -a -U fish_color_cwd_root + echo "$colors[16]" | read -a -U fish_color_match + echo "$colors[17]" | read -a -U fish_color_search_match + echo "$colors[18]" | read -a -U fish_color_selection + echo "$colors[19]" | read -a -U fish_pager_color_prefix + echo "$colors[20]" | read -a -U fish_pager_color_completion + echo "$colors[21]" | read -a -U fish_pager_color_description + echo "$colors[22]" | read -a -U fish_pager_color_progress + echo "$colors[23]" | read -a -U fish_color_history_current + echo "$colors[24]" | read -a -U fish_color_host + + command rm -f $fish_colors_config + end + end + + for file in $path/conf.d/*.{py,awk} + set -l base (basename "$file") + command rm -f "$fish_config/conf.d/$base" + end + + for file in $path/{functions/,}*.{py,awk} + set -l base (basename "$file") + command rm -f "$fish_config/functions/$base" + end + + for file in $path/conf.d/*.fish + set -l base (basename "$file") + command rm -f "$fish_config/conf.d/$base" + end + + for file in $path/completions/*.fish + set -l name (basename "$file" .fish) + set -l base "$name.fish" + + command rm -f "$fish_config/completions/$base" + complete -c "$name" --erase + end + + if __fisher_plugin_is_prompt "$path" + set -U fisher_active_prompt + builtin source $__fish_datadir/functions/fish_prompt.fish ^ /dev/null + end + + command rm -rf "$path" > /dev/stderr +end + + +function __fisher_get_plugin_name_from_gist -a url + set -l gist_id (printf "%s\n" "$url" | command sed 's|.*/||') + set -l name (fish -c " + + fisher -v > /dev/null + curl -Ss https://api.github.com/gists/$gist_id & + + __fisher_jobs_await (__fisher_jobs_get -l) + + " | command awk ' + + /"files": / { + files++ + } + + /"[^ ]+.fish": / && files { + gsub("^ *\"|\.fish.*", "") + print + } + + ') + + if test -z "$name" + return 1 + end + + printf "%s\n" $name +end + + +function __fisher_list + set -l config $fisher_config/* + + if test -z "$config" + return 1 + end + + set -l white + set -l links (command find $config -maxdepth 0 -type l ! -name "$fisher_active_prompt" ^ /dev/null) + set -l names (command find $config -maxdepth 0 -type d ! -name "$fisher_active_prompt" ^ /dev/null) + + if test ! -z "$links" + set white " " + printf "%s\n" $links | command sed "s|.*/|@ |" + end + + if test ! -z "$fisher_active_prompt" + set white " " + printf "* %s\n" "$fisher_active_prompt" + end + + if test ! -z "$names" + printf "%s\n" $names | command sed "s|.*/|$white|" + end +end + + +function __fisher_list_plugin_directory -a item + set -l fd $__fisher_stderr + + set -e argv[1] + set -l path "$fisher_config/$item" + + if test ! -d "$path" + __fisher_log error "$item is not installed" $__fisher_stderr + + return 1 + end + + pushd "$path" + + set -l color (set_color $fish_color_command) + set -l nc (set_color normal) + set -l inside_tree + + if contains -- --no-color $argv + set color + set nc + set fd $__fisher_stdout + end + + printf "$color%s$nc\n" "$PWD" > $fd + + for file in .* ** + if test -f "$file" + switch "$file" + case .\* + printf " %s\n" $file + set inside_tree + + case \*/\* + if test -z "$inside_tree" + printf " $color%s/$nc\n" (dirname $file) + set inside_tree - + end + printf " %s\n" (basename $file) + + case \* + printf " %s\n" $file + set inside_tree + end + end + end > $fd + + popd +end + + +function __fisher_log -a log message fd + set -l nc (set_color normal) + set -l okay (set_color green) + set -l info (set_color green) + set -l warn (set_color yellow) + set -l error (set_color red) + + switch "$fd" + case "/dev/null" + return + + case "" "/dev/stderr" + set fd "/dev/stderr" + + case \* + set nc "" + set okay "" + set info "" + set warn "" + set error "" + end + + printf "%s\n" "$message" | command awk ' + function okay(s) { + printf("'$okay'%s'$nc' %s\n", "OKAY", s) + } + + function info(s) { + printf("'$info'%s'$nc' %s\n", "INFO", s) + } + + function warn(s) { + printf("'$warn'%s'$nc' %s\n", "WARN", s) + } + + function error(s) { + printf("'$error'%s'$nc' %s\n", "ARGH", s) + } + + { + sub(/^[ ]+/, "") + gsub("``", " ") + + if (/@[^@]+@/) { + n = match($0, /@[^@]+@/) + if (n) { + sub(/@[^@]+@/, "'"$$log"'" substr($0, RSTART + 1, RLENGTH - 2) "'$nc'", $0) + } + } + + s[++len] = $0 + } + + END { + for (i = 1; i <= len; i++) { + if ((i == 1 || i == len) && (s[i] == "")) { + continue + } + + if (s[i] == "") { + print + } else { + '$log'(s[i]) + } + } + } + + ' > "$fd" +end + + +function __fisher_jobs_get + jobs $argv | 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 + } + ' +end + + +function __fisher_jobs_await + if test -z "$argv" + return + end + + while true + for spinner in $fisher_spinners + printf " $spinner \r" > /dev/stderr + sleep 0.04 + end + + set -l currently_active_jobs (__fisher_jobs_get) + + if test -z "$currently_active_jobs" + break + end + + set -l has_jobs + + for i in $argv + if builtin contains -- $i $currently_active_jobs + set has_jobs "*" + break + end + end + + if test -z "$has_jobs" + break + end + end +end + + +function __fisher_key_bindings_remove -a plugin_name + set -l user_key_bindings "$fish_config/functions/fish_user_key_bindings.fish" + set -l tmp (date "+%s") + + fish_indent < "$user_key_bindings" | sed -n "/### $plugin_name ###/,/### $plugin_name ###/{s/^ *bind /bind -e /p;};" | source ^ /dev/null + + sed "/### $plugin_name ###/,/### $plugin_name ###/d" < "$user_key_bindings" > "$user_key_bindings.$tmp" + command mv -f "$user_key_bindings.$tmp" "$user_key_bindings" + + if awk ' + /^$/ { next } + + /^function fish_user_key_bindings/ { + i++ + next + } + + /^end$/ && 1 == i { + exit 0 + } + + // { + exit 1 + } + + ' < "$user_key_bindings" + + command rm -f "$user_key_bindings" + end +end + + +function __fisher_key_bindings_append -a plugin_name file + set -l user_key_bindings "$fish_config/functions/fish_user_key_bindings.fish" + + command mkdir -p (dirname "$user_key_bindings") + touch "$user_key_bindings" + + set -l key_bindings_source ( + fish_indent < "$user_key_bindings" | awk ' + + /^function fish_user_key_bindings/ { + reading_function_source = 1 + next + } + + /^end$/ { + exit + } + + reading_function_source { + print $0 + next + } + + ' + ) + + set -l plugin_key_bindings_source ( + fish_indent < "$file" | awk -v name="$plugin_name" ' + + BEGIN { + printf("### %s ###\n", name) + } + + END { + printf("### %s ###\n", name) + } + + /^function fish_user_key_bindings$/ { + check_for_and_keyword = 1 + next + } + + /^end$/ && check_for_and_keyword { + end = 0 + next + } + + !/^ *(#.*)*$/ { + gsub("#.*", "") + printf("%s\n", $0) + } + + ' + ) + + printf "%s\n" $key_bindings_source $plugin_key_bindings_source | awk ' + + BEGIN { + print "function fish_user_key_bindings" + } + + // + + END { + print "end" + } + + ' | fish_indent > "$user_key_bindings" +end + + +function __fisher_plugin_is_prompt -a path + if test -e $path/fish_prompt.fish + return + end + + if test -e $path/functions/fish_prompt.fish + return + end + + if test -e $path/fish_right_prompt.fish + return + end + + if test -e $path/functions/fish_right_prompt.fish + return + end + + return 1 +end + + +function __fisher_plugin_get_names + printf "%s\n" $argv | command awk ' + + { + sub(/\/$/, "") + n = split($0, s, "/") + sub(/^(omf|omf-theme|omf-plugin|plugin|theme|fish|fisher)-/, "", s[n]) + + printf("%s\n%s\n", s[n], s[n - 1]) + } + + ' +end + + +function __fisher_plugin_get_url_info -a option + set -e argv[1] + + if test -z "$argv" + return + end + + cat {$argv}/.git/config ^ /dev/null | command awk -v option="$option" ' + /url/ { + n = split($3, s, "/") + + if ($3 ~ /https:\/\/gist/) { + printf("# %s\n", $3) + next + } + + if (option == "--dirname") { + printf("%s\n", s[n - 1]) + + } else if (option == "--basename") { + printf("%s\n", s[n]) + + } else { + printf("%s/%s\n", s[n - 1], s[n]) + } + } + ' +end + + +function __fisher_plugin_normalize_path + printf "%s\n" $argv | command awk -v pwd="$PWD" ' + + /^\.$/ { + print(pwd) + next + } + + /^\// { + sub(/\/$/, "") + print($0) + next + } + + { + print(pwd "/" $0) + next + } + + ' +end + + +function __fisher_plugin_get_missing + for i in $argv + if test -d "$i" + set i (__fisher_plugin_normalize_path "$i") + end + + set -l name (__fisher_plugin_get_names "$i")[1] + + if set -l path (__fisher_plugin_is_installed "$name") + for file in fishfile bundle + if test -s "$path/$file" + __fisher_plugin_get_missing (__fisher_read_bundle_file < "$path/$file") + end + end + else + printf "%s\n" "$i" + end + end + + __fisher_show_spinner +end + + +function __fisher_plugin_is_installed -a name + if test -z "$name" -o ! -d "$fisher_config/$name" + return 1 + end + + printf "%s\n" "$fisher_config/$name" +end + + +function __fisher_reset_default_fish_colors + 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 +end + + +function __fisher_read_bundle_file + command awk -v FS=\t ' + /^$/ || /^[ \t]*#/ { + next + } + + /^[ \t]*package / { + sub("^[ \t]*package ", "oh-my-fish/plugin-") + } + + { + sub("^[@* \t]*", "") + + if (!seen[$0]++) { + printf("%s\n", $0) + } + } + ' +end + + +function __fisher_completions_write + functions __fisher_completions_write | fish_indent | __fisher_parse_comments_from_function + + # complete -xc fisher -s h -l help -d "Show usage help" + # complete -xc fisher -s q -l quiet -d "Enable quiet mode" + # complete -xc fisher -s v -l version -d "Show version information" + # complete -xc fisher -n "__fish_use_subcommand" -a install -d "Install plugins / i" + # complete -xc fisher -n "__fish_use_subcommand" -a update -d "Update itself and plugins / u" + # complete -xc fisher -n "__fish_use_subcommand" -a rm -d "Remove plugins / r" + # complete -xc fisher -n "__fish_use_subcommand" -a ls -d "List plugins / l" + # complete -xc fisher -n "__fish_use_subcommand" -a help -d "Show help / h" +end + + +function __fisher_humanize_duration + awk ' + function hmTime(time, stamp) { + split("h:m:s:ms", units, ":") + + for (i = 2; i >= -1; i--) { + if (t = int( i < 0 ? time % 1000 : time / (60 ^ i * 1000) % 60 )) { + stamp = stamp t units[sqrt((i - 2) ^ 2) + 1] " " + } + } + + if (stamp ~ /^ *$/) { + return "0ms" + } + + return substr(stamp, 1, length(stamp) - 1) + } + + { + print hmTime($0) + } + ' +end + + +function __fisher_get_key + stty -icanon -echo ^ /dev/null + + printf "$argv" > /dev/stderr + + while true + dd bs=1 count=1 ^ /dev/null | read -p "" -l yn + + switch "$yn" + case y Y n N + printf "\n" > /dev/stderr + printf "%s\n" $yn > /dev/stdout + break + end + end + + stty icanon echo > /dev/stderr ^ /dev/null +end + + +function __fisher_get_epoch_in_ms -a elapsed + if test -z "$elapsed" + set elapsed 0 + end + + perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$elapsed')' +end + + +function __fisher_parse_column_output + command awk -v FS=\t ' + { + + for (i = 1; i <= NF; i++) { + if ($i != "") { + print $i + } + } + + } + ' +end + + +function __fisher_parse_comments_from_function + command awk ' + + /^[\t ]*# ?/ { + sub(/^[\t ]*# ?/, "") + a[++n] = $0 + } + + END { + for (i = 1; i <= n; i++) { + printf("%s\n", a[i]) + } + } + + ' +end + + +function __fisher_usage + set -l u (set_color -u) + set -l nc (set_color normal) + + echo "Usage: fisher [] [] [--quiet] [--version]" + echo + echo "where can be one of:" + echo " "$u"i"$nc"nstall (default)" + echo " "$u"u"$nc"pdate" + echo " "$u"r"$nc"m" + echo " "$u"l"$nc"s" + echo " "$u"h"$nc"elp" +end + + +function __fisher_help -a command number + if test -z "$argv" + set -l page "$fisher_cache/fisher.1" + + if test ! -s "$page" + __fisher_man_page_write > "$page" + end + + set -l pager "/usr/bin/less -s" + + if test ! -z "$PAGER" + set pager "$PAGER" + end + + man -P "$pager" -- "$page" + + command rm -f "$page" + + else + if test -z "$number" + set number 1 + end + + set -l page "$fisher_config/$cmd/man/man$number/$cmd.$number" + + if not man "$page" ^ /dev/null + __fisher_log error "No manual entry for $cmd" $__fisher_stderr + + if test -d "$fisher_config/$cmd" + set -l url (__fisher_plugin_get_url_info -- $fisher_config/$cmd) + + if test ! -z "$url" + __fisher_log info "Visit the online repository for help:" $__fisher_stderr + __fisher_log info "@https://github.com/$url@" $__fisher_stderr + end + else + __fisher_log error "$cmd is not installed" $__fisher_stderr + end + + return 1 + end + end +end + + +function __fisher_self_uninstall + if test -z "$fish_config" -o -z "$fisher_cache" -o -z "$fisher_config" -o -L "$fisher_cache" -o -L "$fisher_config" + __fisher_log error " + + Some of fisherman variables refer to symbolic links or were undefined. + + If you are running a custom fisherman setup, remove the following + directories and files by yourself: + + @$fisher_cache@ + @$fisher_config@ + @$fish_config/functions/fisher.fish@ + @$fish_config/completions/fisher.fish@ + + " /dev/stderr + + return 1 + end + + set -l u (set_color -u) + set -l nc (set_color normal) + + switch "$argv" + case -y --yes + case \* + __fisher_log warn " + This will permanently remove fisherman from your system. + The following directories and files will be erased: + + $fisher_cache + $fisher_config + $fish_config/functions/fisher.fish + $fish_config/completions/fisher.fish + + " /dev/stderr + + echo -sn "Do you wish to continue? [Y/n] " > /dev/stderr + + __fisher_get_key | read -l yn + + switch "$yn" + case n N + set -l username + + if test ! -z "$USER" + set username " $USER" + end + + __fisher_log okay "As you wish cap!" + return 1 + end + end + + complete -c fisher --erase + + __fisher_show_spinner + + fisher ls | fisher rm + + __fisher_show_spinner + + command rm -rf "$fisher_cache" "$fisher_config" + command rm -f "$fish_config"/{functions,completions}/fisher.fish "$fisher_bundle" + + __fisher_show_spinner + + set -e fisher_active_prompt + set -e fisher_cache + set -e fisher_config + set -e fish_config + set -e fisher_bundle + set -e fisher_version + set -e fisher_spinners + + for func in __fisher_jobs_await __fisher_plugin_url_clone_async __fisher_completions_write __fisher_plugin_fetch_items __fisher_get_epoch_in_ms __fisher_jobs_get __fisher_get_key __fisher_get_plugin_name_from_gist __fisher_plugin_get_names __fisher_plugin_get_url_info __fisher_plugin_get_missing __fisher_help __fisher_humanize_duration __fisher_install __fisher_list __fisher_list_plugin_directory __fisher_man_page_write __fisher_plugin_normalize_path __fisher_parse_column_output __fisher_parse_comments_from_function __fisher_plugin_is_prompt __fisher_plugin_disable __fisher_plugin_enable __fisher_plugin_is_installed __fisher_read_bundle_file __fisher_reset_default_fish_colors __fisher_self_uninstall __fisher_self_update __fisher_usage __fisher_update __fisher_update_path_async + __fisher_show_spinner + functions -e "$func" + end + + __fisher_show_spinner + + functions -e __fisher_show_spinner + + __fisher_log okay " + + Thanks for trying out fisherman. If you have a moment, + please share your feedback with us on the issue tracker. + + @https://github.com/fisherman/fisherman/issues@ + + " $__fisher_stderr + + functions -e __fisher_log +end + + +function __fisher_man_page_write + functions __fisher_man_page_write | fish_indent | __fisher_parse_comments_from_function + + # . + # .TH "FISHERMAN" "1" "April 2016" "" "fisherman" + # . + # .SH "NAME" + # \fBfisherman\fR \- fish shell plugin manager + # . + # .SH "SYNOPSIS" + # fisher [\fIcommand\fR] [\fIplugins\fR] [\-\-quiet] [\-\-version] + # . + # .br + # . + # .P + # where \fIcommand\fR can be one of: \fBi\fRnstall, \fBu\fRpdate, \fBls\fR, \fBrm\fR and \fBh\fRelp + # . + # .SH "DESCRIPTION" + # fisherman is a zero\-configuration, concurrent plugin manager for the fish shell\. + # . + # .SH "USAGE" + # Install a plugin\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher simple + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Install from multiple sources\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher z fzf omf/{grc,thefuck} + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Install from a url\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher https://github\.com/edc/bass + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Install from a gist\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher https://gist\.github\.com/username/1f40e1c6e0551b2666b2 + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Install from a local directory\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher ~/my_aliases + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Use it a la vundle\. Edit your fishfile and run \fBfisher\fR to satisfy changes\. + # . + # .P + # See \fIFAQ\fR#What is a fishfile and how do I use it? + # . + # .IP "" 4 + # . + # .nf + # + # $EDITOR fishfile # add plugins + # fisher + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # See what\'s installed\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher ls + # @ my_aliases # this plugin is a local directory + # * simple # this plugin is the current prompt + # bass + # fzf + # grc + # thefuck + # z + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Update everything\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher up + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Update some plugins\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher up bass z fzf thefuck + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Remove plugins\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher rm simple + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Remove all the plugins\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher ls | fisher rm + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # Get help\. + # . + # .IP "" 4 + # . + # .nf + # + # fisher help z + # . + # .fi + # . + # .IP "" 0 + # . + # .SH "OPTIONS" + # . + # .IP "\(bu" 4 + # \-v, \-\-version Show version information\. + # . + # .IP "\(bu" 4 + # \-h, \-\-help Show usage help\. Use the long form to display this page instead\. + # . + # .IP "\(bu" 4 + # \-q, \-\-quiet Enable quiet mode\. Use to suppress output\. + # . + # .IP "" 0 + # . + # .SH "FAQ" + # . + # .SS "1\. What fish version is required?" + # 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 \fB~/\.config/fish/config\.fish\fR for snippet support\. + # . + # .IP "" 4 + # . + # .nf + # + # for file in ~/\.config/fish/conf\.d/*\.fish + # source $file + # end + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "2\. How do I install fish on OS X?" + # With Homebrew\. + # . + # .IP "" 4 + # . + # .nf + # + # brew install fish + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "3\. How do I install the latest fish on some Linux?" + # With git, from the source\. + # . + # .IP "" 4 + # . + # .nf + # + # sudo apt\-get \-y install git gettext automake autoconf \e + # 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 + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "4\. How do I use fish as my default shell?" + # Add fish to the list of login shells in \fB/etc/shells\fR and make it your default shell\. + # . + # .IP "" 4 + # . + # .nf + # + # echo "/usr/local/bin/fish" | sudo tee \-a /etc/shells + # chsh \-s /usr/local/bin/fish + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "5\. How do I uninstall fisherman?" + # Run + # . + # .IP "" 4 + # . + # .nf + # + # fisher self\-uninstall + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "6\. Is fisherman compatible with oh my fish themes and plugins?" + # Yes\. + # . + # .SS "7\. Why fisherman? Why not ____?" + # fisherman has / is: + # . + # .IP "\(bu" 4 + # small and fits in one file + # . + # .IP "\(bu" 4 + # zero impact on shell startup time + # . + # .IP "\(bu" 4 + # fast and easy to install, update and uninstall + # . + # .IP "\(bu" 4 + # no need to edit your fish configuration + # . + # .IP "\(bu" 4 + # correct usage of the XDG base directory spec + # . + # .IP "" 0 + # . + # .SS "8\. Where does fisherman put stuff?" + # fisherman goes in \fB~/\.config/fish/functions/fisher\.fish\fR\. + # . + # .P + # The cache and plugin configuration is created in \fB~/\.cache/fisherman\fR and \fB~/\.config/fisherman\fR respectively\. + # . + # .P + # The fishfile is saved to \fB~/\.config/fish/fishfile\fR\. + # . + # .SS "9\. What is a fishfile and how do I use it?" + # The fishfile \fB~/\.config/fish/fishfile\fR lists all the installed plugins\. + # . + # .P + # You can let fisherman take care of this file for you automatically, or write in the plugins you want and run \fBfisher\fR to satisfy the changes\. + # . + # .IP "" 4 + # . + # .nf + # + # fisherman/simple + # fisherman/z + # omf/thefuck + # omf/grc + # . + # .fi + # . + # .IP "" 0 + # . + # .P + # This mechanism only installs plugins and missing dependencies\. To remove a plugin, use \fBfisher rm\fR instead\. + # . + # .SS "10\. Where can I find a list of fish plugins?" + # Browse the github/fisherman organization or use the online \fIhttp://fisherman\.sh/#search\fR search to discover content\. + # . + # .SS "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\. + # . + # .SS "12\. What is a plugin?" + # A plugin is: + # . + # .IP "1." 4 + # a directory or git repo with a function \fB\.fish\fR file either at the root level of the project or inside a \fBfunctions\fR directory + # . + # .IP "2." 4 + # a theme or prompt, i\.e, a \fBfish_prompt\.fish\fR, \fBfish_right_prompt\.fish\fR or both files + # . + # .IP "3." 4 + # a snippet, i\.e, one or more \fB\.fish\fR files inside a directory named \fBconf\.d\fR that are evaluated by fish at the start of the shell + # . + # .IP "" 0 + # . + # .SS "13\. How can I list plugins as dependencies to my plugin?" + # Create a new \fBfishfile\fR file at the root level of your project and write in the plugin dependencies\. + # . + # .IP "" 4 + # . + # .nf + # + # owner/repo + # https://github\.com/dude/sweet + # https://gist\.github\.com/bucaran/c256586044fea832e62f02bc6f6daf32 + # . + # .fi + # . + # .IP "" 0 + # . + # .SS "14\. What about fundle?" + # fundle inspired me to use a bundle file, but it still has limited capabilities and requires you to modify your fish configuration\. + # . + # .SS "15\. I have a question or request not addressed here\. Where should I put it?" + # Create a new ticket on the issue tracker: + # . + # .IP "\(bu" 4 + # https://github\.com/fisherman/fisherman/issues + # . + # .IP "" 0 +end diff --git a/functions/__fisher_cache_list.fish b/functions/__fisher_cache_list.fish deleted file mode 100644 index c1dfe35..0000000 --- a/functions/__fisher_cache_list.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_cache_list - command find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||' -end diff --git a/functions/__fisher_complete.fish b/functions/__fisher_complete.fish deleted file mode 100644 index ffc0e0b..0000000 --- a/functions/__fisher_complete.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_complete_reset.fish b/functions/__fisher_complete_reset.fish deleted file mode 100644 index 2dfadb0..0000000 --- a/functions/__fisher_complete_reset.fish +++ /dev/null @@ -1,4 +0,0 @@ -function __fisher_complete_reset - complete -ec fisher - source $fisher_home/completions/fisher.fish -end diff --git a/functions/__fisher_config_color_reset.fish b/functions/__fisher_config_color_reset.fish deleted file mode 100644 index 14e5c3f..0000000 --- a/functions/__fisher_config_color_reset.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_config_color_save.fish b/functions/__fisher_config_color_save.fish deleted file mode 100644 index 8ae849a..0000000 --- a/functions/__fisher_config_color_save.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_file.fish b/functions/__fisher_file.fish deleted file mode 100644 index b92d161..0000000 --- a/functions/__fisher_file.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_file_contains.fish b/functions/__fisher_file_contains.fish deleted file mode 100644 index dc84538..0000000 --- a/functions/__fisher_file_contains.fish +++ /dev/null @@ -1,4 +0,0 @@ -function __fisher_file_contains -a plugin - set -e argv[1] - grep -E "^(package *|plugin *)?$plugin.*\$" $argv -end diff --git a/functions/__fisher_file_remove.fish b/functions/__fisher_file_remove.fish deleted file mode 100644 index a052762..0000000 --- a/functions/__fisher_file_remove.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_gist_to_name.fish b/functions/__fisher_gist_to_name.fish deleted file mode 100644 index aedb276..0000000 --- a/functions/__fisher_gist_to_name.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_help_commands.fish b/functions/__fisher_help_commands.fish deleted file mode 100644 index 8ae1c33..0000000 --- a/functions/__fisher_help_commands.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_help_parse.fish b/functions/__fisher_help_parse.fish deleted file mode 100644 index 68b89fc..0000000 --- a/functions/__fisher_help_parse.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_help_parse - sed -nE 's/^ *(-(.))?,? *--([^ =[]+) *(.*)$/\4;\3;\2/p' -end diff --git a/functions/__fisher_help_usage.fish b/functions/__fisher_help_usage.fish deleted file mode 100644 index 9bfb3de..0000000 --- a/functions/__fisher_help_usage.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_index_update.fish b/functions/__fisher_index_update.fish deleted file mode 100644 index d6544a5..0000000 --- a/functions/__fisher_index_update.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_key_bindings.fish b/functions/__fisher_key_bindings.fish deleted file mode 100644 index 1a9206b..0000000 --- a/functions/__fisher_key_bindings.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_key_bindings - source $fisher_binds ^ /dev/null -end diff --git a/functions/__fisher_key_bindings_delete.fish b/functions/__fisher_key_bindings_delete.fish deleted file mode 100644 index 6a1d3d4..0000000 --- a/functions/__fisher_key_bindings_delete.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_key_bindings_delete -a plugin - sed "/##$plugin##/,/##$plugin##/d" -end diff --git a/functions/__fisher_key_bindings_disable.fish b/functions/__fisher_key_bindings_disable.fish deleted file mode 100644 index e5f3457..0000000 --- a/functions/__fisher_key_bindings_disable.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_key_bindings_enable.fish b/functions/__fisher_key_bindings_enable.fish deleted file mode 100644 index 6809b70..0000000 --- a/functions/__fisher_key_bindings_enable.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_key_bindings_reset.fish b/functions/__fisher_key_bindings_reset.fish deleted file mode 100644 index a486230..0000000 --- a/functions/__fisher_key_bindings_reset.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_key_bindings_undo.fish b/functions/__fisher_key_bindings_undo.fish deleted file mode 100644 index f59e817..0000000 --- a/functions/__fisher_key_bindings_undo.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_key_bindings_undo -a plugin - sed -n "/##$plugin##/,/##$plugin##/{s/^ *bind /bind -e /p;};" -end diff --git a/functions/__fisher_key_bindings_update.fish b/functions/__fisher_key_bindings_update.fish deleted file mode 100644 index 2de0cb3..0000000 --- a/functions/__fisher_key_bindings_update.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_key_bindings_update_user.fish b/functions/__fisher_key_bindings_update_user.fish deleted file mode 100644 index 8971262..0000000 --- a/functions/__fisher_key_bindings_update_user.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_list.fish b/functions/__fisher_list.fish deleted file mode 100644 index 3013fb6..0000000 --- a/functions/__fisher_list.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_list - __fisher_file | __fisher_name -end diff --git a/functions/__fisher_name.fish b/functions/__fisher_name.fish deleted file mode 100644 index 6ab8612..0000000 --- a/functions/__fisher_name.fish +++ /dev/null @@ -1,6 +0,0 @@ -function __fisher_name - sed -E ' - s|.*/(.*)|\1| - s/(plugin|omf-theme|theme|pkg|omf|fish|fisher|fisherman)-//g - ' -end diff --git a/functions/__fisher_path_from_plugin.fish b/functions/__fisher_path_from_plugin.fish deleted file mode 100644 index 8844855..0000000 --- a/functions/__fisher_path_from_plugin.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_path_from_url.fish b/functions/__fisher_path_from_url.fish deleted file mode 100644 index 5eda3da..0000000 --- a/functions/__fisher_path_from_url.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_path_is_prompt.fish b/functions/__fisher_path_is_prompt.fish deleted file mode 100644 index 4f82891..0000000 --- a/functions/__fisher_path_is_prompt.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_path_update.fish b/functions/__fisher_path_update.fish deleted file mode 100644 index b735ae3..0000000 --- a/functions/__fisher_path_update.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_can_enable.fish b/functions/__fisher_plugin_can_enable.fish deleted file mode 100644 index e23cee5..0000000 --- a/functions/__fisher_plugin_can_enable.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_disable.fish b/functions/__fisher_plugin_disable.fish deleted file mode 100644 index b3ff9a1..0000000 --- a/functions/__fisher_plugin_disable.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_enable.fish b/functions/__fisher_plugin_enable.fish deleted file mode 100644 index a728b5b..0000000 --- a/functions/__fisher_plugin_enable.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_fetch.fish b/functions/__fisher_plugin_fetch.fish deleted file mode 100644 index 388f06d..0000000 --- a/functions/__fisher_plugin_fetch.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_from_path.fish b/functions/__fisher_plugin_from_path.fish deleted file mode 100644 index d14ccd5..0000000 --- a/functions/__fisher_plugin_from_path.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_link.fish b/functions/__fisher_plugin_link.fish deleted file mode 100644 index 87707da..0000000 --- a/functions/__fisher_plugin_link.fish +++ /dev/null @@ -1,4 +0,0 @@ -function __fisher_plugin_link -a options source target - debug "link %s" $target - command ln $options $source $target -end diff --git a/functions/__fisher_plugin_source.fish b/functions/__fisher_plugin_source.fish deleted file mode 100644 index a47a71f..0000000 --- a/functions/__fisher_plugin_source.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_plugin_source -a plugin file - source "$file" ^ /dev/null -end diff --git a/functions/__fisher_plugin_uninstall_handler.fish b/functions/__fisher_plugin_uninstall_handler.fish deleted file mode 100644 index 7dc6820..0000000 --- a/functions/__fisher_plugin_uninstall_handler.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_unlink.fish b/functions/__fisher_plugin_unlink.fish deleted file mode 100644 index 7c0dd0e..0000000 --- a/functions/__fisher_plugin_unlink.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_validate.fish b/functions/__fisher_plugin_validate.fish deleted file mode 100644 index b70a355..0000000 --- a/functions/__fisher_plugin_validate.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_plugin_walk.fish b/functions/__fisher_plugin_walk.fish deleted file mode 100644 index b6bd661..0000000 --- a/functions/__fisher_plugin_walk.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_prompt_reset.fish b/functions/__fisher_prompt_reset.fish deleted file mode 100644 index f91c6d3..0000000 --- a/functions/__fisher_prompt_reset.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_string_escape.fish b/functions/__fisher_string_escape.fish deleted file mode 100644 index f766c00..0000000 --- a/functions/__fisher_string_escape.fish +++ /dev/null @@ -1,3 +0,0 @@ -function __fisher_string_escape - sed 's|/|\\\/|g' -end diff --git a/functions/__fisher_url_clone.fish b/functions/__fisher_url_clone.fish deleted file mode 100644 index aee408b..0000000 --- a/functions/__fisher_url_clone.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_url_from_path.fish b/functions/__fisher_url_from_path.fish deleted file mode 100644 index 88eb52f..0000000 --- a/functions/__fisher_url_from_path.fish +++ /dev/null @@ -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 diff --git a/functions/__fisher_xdg.fish b/functions/__fisher_xdg.fish deleted file mode 100644 index 06af145..0000000 --- a/functions/__fisher_xdg.fish +++ /dev/null @@ -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 diff --git a/functions/debug.fish b/functions/debug.fish deleted file mode 100644 index 525f8e1..0000000 --- a/functions/debug.fish +++ /dev/null @@ -1,2 +0,0 @@ -function debug -end diff --git a/functions/fish_config.fish b/functions/fish_config.fish deleted file mode 100644 index 7eb0c1c..0000000 --- a/functions/fish_config.fish +++ /dev/null @@ -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 diff --git a/functions/fisher.fish b/functions/fisher.fish deleted file mode 100644 index a07fc71..0000000 --- a/functions/fisher.fish +++ /dev/null @@ -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 [] [--help] [--version]\n\n" - - set -l color (set_color -u) - set -l color_normal (set_color normal) - - printf "where can be one of:\n" - - __fisher_help_commands | sed " - s/^/ / - s/;/"\t" / - " | column -ts\t - end -end diff --git a/functions/fisher_help.fish b/functions/fisher_help.fish deleted file mode 100644 index 9bdecca..0000000 --- a/functions/fisher_help.fish +++ /dev/null @@ -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 []\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 diff --git a/functions/fisher_install.fish b/functions/fisher_install.fish deleted file mode 100644 index 135f5d1..0000000 --- a/functions/fisher_install.fish +++ /dev/null @@ -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 [] [--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 diff --git a/functions/fisher_list.fish b/functions/fisher_list.fish deleted file mode 100644 index 8337126..0000000 --- a/functions/fisher_list.fish +++ /dev/null @@ -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 diff --git a/functions/fisher_search.fish b/functions/fisher_search.fish deleted file mode 100644 index 63e6c55..0000000 --- a/functions/fisher_search.fish +++ /dev/null @@ -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 [] [--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 diff --git a/functions/fisher_uninstall.fish b/functions/fisher_uninstall.fish deleted file mode 100644 index 148e3fa..0000000 --- a/functions/fisher_uninstall.fish +++ /dev/null @@ -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 [] [--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 diff --git a/functions/fisher_update.fish b/functions/fisher_update.fish deleted file mode 100644 index 290772e..0000000 --- a/functions/fisher_update.fish +++ /dev/null @@ -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 [] [--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 diff --git a/functions/getopts.fish b/functions/getopts.fish deleted file mode 100644 index e692dec..0000000 --- a/functions/getopts.fish +++ /dev/null @@ -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 diff --git a/functions/man.fish b/functions/man.fish deleted file mode 100644 index 1f11be4..0000000 --- a/functions/man.fish +++ /dev/null @@ -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 diff --git a/functions/spin.fish b/functions/spin.fish deleted file mode 100644 index 680ec38..0000000 --- a/functions/spin.fish +++ /dev/null @@ -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 [--style=