https://github.com/maxpleaner/fish_functions
https://github.com/maxpleaner/fish_functions
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxpleaner/fish_functions
- Owner: MaxPleaner
- Created: 2017-04-12T07:01:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T17:51:05.000Z (over 8 years ago)
- Last Synced: 2025-03-24T06:34:28.542Z (about 1 year ago)
- Language: Shell
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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