The Fish Shell Framework
Go to file
Justin Hileman 0359ba047c Merge $OMF_CONFIG and $OMF_CUSTOM.
Per conversation with @bpinto in Gitter.

There's no need for two separate directories. You don't have a `.git` and `.git-custom` folder, you just put your config in `.git` :)

The most straightforward interpretation of XDG basedir spec is that user configuration for omf would go in `~/.config/omf`, so let's put it there. The only question is whether omf-generated config (i.e. the `theme` file) should go there as well. By analogy with git, programmatically generated config should probably be merged in with user config. This also makes it so when a user clones their dotfiles to a new machine, both kinds of settings come with it.
2015-08-27 11:02:30 -07:00
bin Merge $OMF_CONFIG and $OMF_CUSTOM. 2015-08-27 11:02:30 -07:00
db Add local-config 2015-08-27 10:15:03 -07:00
lib fix basename polyfill 2015-08-27 03:55:16 +09:00
pkg/omf Merge $OMF_CONFIG and $OMF_CUSTOM. 2015-08-27 11:02:30 -07: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 Merge $OMF_CONFIG and $OMF_CUSTOM. 2015-08-27 11:02:30 -07:00
init.fish Merge $OMF_CONFIG and $OMF_CUSTOM. 2015-08-27 11:02:30 -07:00
LICENSE %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
README.md Merge $OMF_CONFIG and $OMF_CUSTOM. 2015-08-27 11:02:30 -07: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 install <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 install URL

omf list

List installed packages.

To list packages available for download use omf install.

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_CONFIG/{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 config path in that order.

The config path (~/.config/omf by default) is defined by $OMF_CONFIG in ~/.config/fish/config.fish. Modify this to load your own configuration 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 🤘