oh-my-fish/lib
Derek Willian Stavis 2c4471a78c autoload: refactor for conformance and performance (#262)
Refactor autoload: Split the big function into two smaller ones,
doing only option parsing at main function.

The algorithm is also rewritten, now in two steps for both path
inclusion an exclusion functions: 1) use auxiliary lists to store
valid function and completion paths, 2) bulk insert or remove just
once in the variable.

Now also respects path insertion policy, keeping user function
path always in front of other paths, thus allowing precedence of
user functions.
2016-06-01 01:14:30 -03:00
..
completions %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
git git_ahead: Fix indicator override 2016-01-21 09:47:11 -02:00
autoload.fish autoload: refactor for conformance and performance (#262) 2016-06-01 01:14:30 -03:00
prompt_segments.fish %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00
README.md Remove basename from core library 2015-11-03 14:02:39 +00:00
require.fish init: rewrite init process (#260) 2016-06-01 01:09:38 -03:00

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.