The Fish Shell Framework
Go to file
2015-08-27 06:15:17 +09:00
bin create empty theme config file during install 2015-08-27 06:15:17 +09:00
db %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
lib fix basename polyfill 2015-08-27 03:55:16 +09:00
pkg/omf fix omf new theme and remove default theme 2015-08-27 06:04:24 +09:00
.editorconfig %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
.gitignore fix omf new theme and remove default theme 2015-08-27 06:04:24 +09:00
.travis.yml %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
CONTRIBUTING.md %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
FAQ.md wa -> omf 2015-08-26 18:03:22 +01:00
init.fish %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
LICENSE %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
README.md Rename omf use to omf theme. 2015-08-26 19:09:11 +01:00

The Fishshell Framework

Fish Version
Build Status
License



⚠️ Important ⚠️

Wahoo and Oh My Fish! are now one project. See this page and FAQ to learn what's new.




About | Install | Getting Started | Advanced | Screencasts | Contributing | FAQ


About

Oh My Fish is an all-purpose framework for the fishshell. It looks after your configuration, themes and packages. It's lightning fast and easy to use.

We love contributions, fork and send us a PR.

Install

curl -L git.io/omf | sh
omf help

Or download and run it yourself:

curl -L git.io/omf > install
chmod +x install
./install

🔰 Getting Started

Oh My Fish includes a small utility omf to fetch and install new packages and themes.

omf update

Update framework and installed packages.

omf get <package> ...

Install one or more themes or packages. To list available packages type omf theme.

You can fetch packages by URL as well via omf get URL

omf list

List installed packages.

To list packages available for download use omf get.

omf theme <theme>

Apply a theme. To list available themes type omf theme.

omf remove <name>

Remove a theme or package.

Packages subscribed to uninstall_<pkg> events are notified before the package is removed to allow custom cleanup of resources. See Uninstall.

omf new pkg | theme <name>

Scaffold out a new package or theme.

This creates a new directory under $OMF_CUSTOM/{pkg | themes}/ with a template.

omf submit pkg/<name> [<url>]

Add a new package. To add a theme use omf submit themes/<name> <url>.

Make sure to send us a PR to update the registry.

omf query <variable name>

Use to inspect all session variables. Useful to dump path variables like $fish_function_path, $fish_complete_path, $PATH, etc.

omf destroy

Uninstall Oh My Fish. See uninstall for more information.

🚩 Advanced

Startup

This script runs each time a new session begins, autoloading packages, themes and your custom path (dotfiles) in that order.

The custom path ($HOME/.dotfiles by default) is defined by $OMF_CUSTOM in $HOME/.config/fish/config.fish. Modify this to load your own dotfiles if you have any.

Core Library

The core library is a minimum set of basic utility functions that extend your shell.

Packages

Creating

A package name may only contain lowercase letters and hyphens to separate words.

To scaffold out a new package:

$ omf new pkg my_package

my_package/
  README.md
  my_package.fish
  completions/my_package.fish

Use omf new theme my_theme for themes.

Please provide auto completion for your utilities if applicable and describe how your package works in the README.md.

my_package.fish defines a single function:

function my_package -d "My package"
end

Bear in mind that fish lacks a private scope so consider the following options to avoid polluting the global namespace:

  • Prefix functions: my_package_my_func.
  • Using blocks.

Submitting

Oh My Fish keeps a registry of packages under $OMF_PATH/db/.

To create a new entry run:

omf submit pkg/my_package .../my_package.git

Similarly for themes use:

omf submit theme/my_theme .../my_theme.git

This will add a new entry to your local copy of the registry. Please send us a PR to update the global registry.

Initialization

If you want to be notified when your package loads, declare the following function in your my_package.fish:

function init -a path --on-event init_mypkg
end

Use this event to modify the environment, load resources, autoload functions, etc. If your package does not export any functions, you can still use this event to add functionality to your package.

Uninstall

Oh My Fish emits uninstall_<pkg> events before a package is removed via omf remove <pkg>. Subscribers can use the event to clean up custom resources, etc.

function uninstall --on-event uninstall_pkg
end

Ignoring

Remove any packages you wish to turn off using omf remove <package name>. Alternatively, you can set a global env variable $OMF_IGNORE in your ~/.config/fish/config.fish with the packages you wish to ignore. For example:

set -g OMF_IGNORE skip this that ...

License

MIT © Oh My Fish 🤘