a164ebdd5d
* init: rewrite init process Now use pure globbing to generate 100% valid function and completion paths, effectively splitting the init process in two steps, one which paths are added, and other when initialization is done (sourcing init). This initialization code introduces a new interface for `init.fish` hook, which deprecates the previously used event model. The new interface injects three variables into `init.fish`: path, package and bundle. This variables can be used by the package to autoload paths, use bundled files, etc. Also supports key bindings by sourcing $OMF_CONFIG/key_bindings.fish and also key_bindings.fish in packages (plugins and themes) root directories. This is done when fish_user_key_bindings is called. * omf: migrate to new init hook * omf/templates: migrate to new init and uninstall hooks * docs: document new init and uninstall hooks interface * README: update new hook interface spec |
||
---|---|---|
.. | ||
completions | ||
git | ||
autoload.fish | ||
prompt_segments.fish | ||
README.md | ||
require.fish |
Core Library
Basic Functions
autoload
[-e] <path>...
Manipulate autoloading path components.
All paths ending with completions
are correctly added to or erased from
$fish_complete_path
.
To add paths to autoload:
autoload $mypath $mypath/completions
To erase paths from autoload:
autoload -e $mypath $mypath/completions
available
<name>
Check if a program is available to run. Sets $status
to 0
if the program is available.
Use this function to check if a plugin is available before using it:
if available battery
battery
end
refresh
Replace the running instance of fishshell with a new one causing Oh My Fish to reload as well.
prompt_segments
Extract the root (top-most parent directory), dirname and basename from fish_prompt
.
Git Functions
git_ahead
Echo a character that represents whether the current repo is ahead, behind or has diverged from its upstream.
Default values:
- ahead:
+
- behind:
-
- diverged:
±
- none:
git_is_repo
Set $status
to 0
if the current working directory belongs to a git repo.
git_branch_name
Echo the currently checked out branch name of the current repo.
git_is_dirty
Set $status
to 0
if there are any changes to files already being tracked in the repo.
git_is_staged
Set $status
to 0
if there staged changes.
git_is_stashed
Set $status
to 0
if there are items in the stash.
git_is_touched
Set $status
to 0
if the repo has any changes whatsoever, including tracked or untracked files.
git_untracked
Echo a \n
separated list of untracked files.