Utility functions for fish shell. Most have been ported from my zsh dotfiles.
<img src="https://img.shields.io/github/tag/halostatue/fish-kiex.svg?label=Version" alt "">
Install with Fisher (recommended):
fisher install halostatue/fish-utils-core halostatue/fish-utils
Not using a package manager?
Copy functions/*.fish
to your fish configuration directory preserving the
directory structure.
- fish 3.0+
Clones the entire directory structure of a SOURCE
directory into another,
using tar with pipes. If TARGET
does not exist, it will be created.
clone-tree source target
-
-p
,--progress
: Enables the display of a progress bar. Ifpv
is not available, acts the same as--verbose
. Mutually exclusive with--verbose
. -
-v
,--verbose
: Shows a verbose extract display. Mutually exclusive with--verbose
. -
-k
,--keep-root
: If provided, keeps the source directory as the root of the target files. That is,clone-tree --keep-root SOURCE TARGET
will produce the output ofTARGET/(basename SOURCE)/...
.
Displays either a color test list or a color test grid. If the list
Creates a data-url base64 encoded value of the file.
dataurl image.jpg | pbcopy
Given a list of files, returns the file that was most recently updated by mtime. Because of limitations of fish, it is not possible to pass wildcards that have no match to this function without first assigning them to a variable.
echo (latest_modified_file Rakefile Gemfile) # Rakefile
set -l files Rakefile lib/tasks/*.rake
echo (latest_modified_file $files) # lib/tasks/test.rake
Prints the maximum value from the provided list.
The comparison must be done on numeric values, but comparisons can be done with
the --using
option to specify a program and arguments to run against the
provided list.
$ max 31 25 92 32
92
$ min 31 25 92 32
25
$ max --using 'path mtime' *.md
CHANGELOG.md
$ max --using 'path mtime' *.md
LICENCE.md
-u
,--using
: A string representing the command to be run to get a numeric value for comparison.
Creates an MD5 hash for the current working directory.
Creates a working 'mess' directory where new things may be played with.
Prints the current working directory of the provided PID.
test (pidwd %self) = $PWD; and echo Works
A simpl{e,istic} Caesar cipher.
echo N fvzcyr Pnrfne pvcure. | rot13
URL encodes the provided string.