You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,28 @@ A plugin can be any number of files in a `functions`, `conf.d`, and `completions
128
128
129
129
Non `.fish` files as well as directories inside those locations will be copied to `$fisher_path` under `functions`, `conf.d`, or `completions` respectively.
130
130
131
+
### Event system
132
+
133
+
Plugins are notified as they are being installed, updated, or removed via Fish [events](https://fishshell.com/docs/current/cmds/emit.html).
134
+
135
+
> `--on-event` functions must already be loaded when their event is emitted. Thus, you should put your event handlers in the `conf.d` directory.
136
+
137
+
```fish
138
+
# Defined in ponyo/conf.d/ponyo.fish
139
+
140
+
function _ponyo_install --on-event ponyo_install
141
+
# Set universal variables, create bindings, and other initialization logic.
142
+
end
143
+
144
+
function _ponyo_update --on-event ponyo_update
145
+
# Migrate resources, print warnings, and other update logic.
146
+
end
147
+
148
+
function _ponyo_uninstall --on-event ponyo_uninstall
149
+
# Erase "private" functions, variables, bindings, and other uninstall logic.
150
+
end
151
+
```
152
+
131
153
## Creating a theme
132
154
133
155
A theme is just like a regular Fish plugin, except it has a `.theme` file in the `themes` directory. Themes were introduced in [Fish 3.4](https://github.com/fish-shell/fish-shell/releases/tag/3.4.0) and work with the `fish_config` builtin. A theme can also have files in `functions`, `conf.d`, or `completions` if necessary. This is what a typical theme plugin might look like.
@@ -140,7 +162,7 @@ A theme is just like a regular Fish plugin, except it has a `.theme` file in the
140
162
└── sosuke.theme
141
163
</pre>
142
164
143
-
## Using `$fisher_path` with themes
165
+
###Using `$fisher_path` with themes
144
166
145
167
If you customize `$fisher_path` to use a directory other than `$__fish_config_dir`, your themes won't be available via `fish_config`. That's because Fish expects your themes to be in `$__fish_config_dir/themes`, not `$fisher_path/themes`. This is not yet configurable in Fish, but there is [a request to add that feature](https://github.com/fish-shell/fish-shell/issues/9456).
If you want to use theme plugins and also maintain your own local themes, you can read more about how to do that here: [#708](https://github.com/jorgebucaran/fisher/issues/708).
160
182
161
-
### Event system
162
-
163
-
Plugins are notified as they are being installed, updated, or removed via Fish [events](https://fishshell.com/docs/current/cmds/emit.html).
164
-
165
-
> `--on-event` functions must already be loaded when their event is emitted. Thus, you should put your event handlers in the `conf.d` directory.
166
-
167
-
```fish
168
-
# Defined in ponyo/conf.d/ponyo.fish
169
-
170
-
function _ponyo_install --on-event ponyo_install
171
-
# Set universal variables, create bindings, and other initialization logic.
172
-
end
173
-
174
-
function _ponyo_update --on-event ponyo_update
175
-
# Migrate resources, print warnings, and other update logic.
176
-
end
177
-
178
-
function _ponyo_uninstall --on-event ponyo_uninstall
179
-
# Erase "private" functions, variables, bindings, and other uninstall logic.
180
-
end
181
-
```
182
-
183
-
### Discoverability
183
+
## Discoverability
184
184
185
185
Fisher doesn't make use of a central repository of plugins. However, that doesn't mean discovering new plugins should be hard. A great way to help people quickly find your project on GitHub is [by adding a topic to your repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics#adding-topics-to-your-repository). We recommend using [`fish-plugin`](https://github.com/topics/fish-plugin) for this purpose.
0 commit comments