An open API service indexing awesome lists of open source software.

https://github.com/maxpleaner/fish_functions


https://github.com/maxpleaner/fish_functions

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

Fish has 'functions' similar to bash's aliases.

Copy these into ~/.config/fish/functions (on ubuntu) and then restart fish.

The following script can be used to clone this repo and copy the files:

```sh
git clone https://github.com/maxpleaner/fish_functions
cd fish_functions
for filename in *.fish; do
new_path=~/.config/fish/functions/$filename
if [ -f $new_path ]; then
echo "$new_path already exists" 1>&2
exit 64
fi
cp $filename $new_path
echo "copied $new_path"
done;
```

There are some "meta functions" included:

- `fn ` to create a function.
Note that `$argv` in the function must be written as `\$argv`,
e.g. `fn agi "sudo apt-get install \$argv"`
- `fs ` an alias for funcsave
- `cfn ` stands for "cat function", shows the body of the function
- `rmfn ` removes a function
- `fns` lists the functions
- `cfdns` changes into the functions directory
- `backup_functions` - performs a backup to git of the functions folder
- there must be a git repo in there on the master branch
- `fndoc ` appends a line to the readme
- **backup_functions**: `cd ~/.config/fish/functions; git add -A; git commit -m ""; git push origin master; cd -` _backups the functions folder into a repo_ - **cdfns**: `cd