{"id":16139552,"url":"https://github.com/bergercookie/fish-function-wrappers","last_synced_at":"2026-05-04T23:35:42.634Z","repository":{"id":78140128,"uuid":"369640435","full_name":"bergercookie/fish-function-wrappers","owner":"bergercookie","description":"Create wrapper functions for common linux commands in Fish","archived":false,"fork":false,"pushed_at":"2022-03-16T09:58:49.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T17:52:01.513Z","etag":null,"topics":["fish-plugin","fish-shell","linux","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bergercookie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-21T19:53:46.000Z","updated_at":"2022-03-16T09:58:52.000Z","dependencies_parsed_at":"2023-02-27T10:00:39.319Z","dependency_job_id":null,"html_url":"https://github.com/bergercookie/fish-function-wrappers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bergercookie/fish-function-wrappers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Ffish-function-wrappers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Ffish-function-wrappers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Ffish-function-wrappers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Ffish-function-wrappers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bergercookie","download_url":"https://codeload.github.com/bergercookie/fish-function-wrappers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Ffish-function-wrappers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259356376,"owners_count":22845244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fish-plugin","fish-shell","linux","python","python3"],"created_at":"2024-10-09T23:49:19.637Z","updated_at":"2026-05-04T23:35:42.563Z","avatar_url":"https://github.com/bergercookie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Function Wrappers for Fish\n\n![badge](https://img.shields.io/badge/fish--shell-fish--function--wrappers-blueviolet) [![CI](https://github.com/bergercookie/fish-function-wrappers/actions/workflows/ci.yml/badge.svg)](https://github.com/bergercookie/fish-function-wrappers/actions/workflows/ci.yml)\n\nPython scripts for generating useful wrapper functions for commonly executed\nUNIX executables for the [Fish shell](https://fishshell.com/).\n\n## Usecases\n\nHow frequently do you have to forward the result of `which`, `find` etc. to\nexecutables like `vim` or `chmod`?\n\n```sh\n# I want to chmod an executable:\n# I can either specify the full path manually..\nchmod u+x /long/path/to/my/executable\n\n# Or I can use which to do that for me.\nchmod u+x (which executable)\n```\n\nHowever both of the above syntaxes are copious to write. Hence here are wrapper\n`fish` functions that will do that for you.\n\n## How do they work?\n\nThe scripts of this repo will create new fish functions, by default under\n`~/.config/fish/functions`, one function for each command specified in the\n`COMMANDS` variable at the beginning of that script.\n\nThis is what it looks like when running these scripts:\n\n```sh\n14:38:58 ➜ ./create-find-wrappers.py\n[CREATE]        cat     -\u003e /home/berger/.config/fish/functions/catF.fish\n[CREATE]        chmod   -\u003e /home/berger/.config/fish/functions/chmodF.fish\n[CREATE]        gvim    -\u003e /home/berger/.config/fish/functions/gvimF.fish\n[CREATE]        ls      -\u003e /home/berger/.config/fish/functions/lsF.fish\n[CREATE]        vi      -\u003e /home/berger/.config/fish/functions/viF.fish\n[CREATE]        vim     -\u003e /home/berger/.config/fish/functions/vimF.fish\n[CREATE]        grep    -\u003e /home/berger/.config/fish/functions/grepF.fish\n[CREATE]        rg      -\u003e /home/berger/.config/fish/functions/rgF.fish\n\n14:39:02 ➜ ./create-which-wrappers.py\n[CREATE]        cat     -\u003e /home/berger/.config/fish/functions/catW.fish\n[CREATE]        chmod   -\u003e /home/berger/.config/fish/functions/chmodW.fish\n[CREATE]        gvim    -\u003e /home/berger/.config/fish/functions/gvimW.fish\n[CREATE]        ls      -\u003e /home/berger/.config/fish/functions/lsW.fish\n[CREATE]        vi      -\u003e /home/berger/.config/fish/functions/viW.fish\n[CREATE]        vim     -\u003e /home/berger/.config/fish/functions/vimW.fish\n[CREATE]        grep    -\u003e /home/berger/.config/fish/functions/grepW.fish\n[CREATE]        rg      -\u003e /home/berger/.config/fish/functions/rgW.fish\n```\n\nEach of these auto-generated functions looks like the following.\n\n\u003cdetails\u003e\n  \u003csummary\u003ecatW.fish\u003c/summary\u003e\u003cp\u003e\n\n```sh\nfunction catW -d \"Run which and pass the resulting executable(s) to cat.\"\n    # All but the last argument are passed to \"cat\" itself.\n    set argc (count $argv)\n    set cmd (status current-command)\n    set args\n    if test $argc -eq 0\n        printf \"I need at least 1 argument.\\nUSAGE: $cmd [flags-of-command] \u003cname-of-executable\u003e\n\"\n        return 1\n    else if test $argc -eq 1\n        set args (which $argv)\n        set executable $argv\n    else\n        set args $argv[1..-2] (which $argv[-1])\n        set executable $argv[-1]\n    end\n\n    if ! which $executable\n        printf  \"Executable $executable was not found by 'which'\"\n        return 1\n    end\n\n    echo Running \"cat $args\"\n    cat $args\n    return 0\nend\n\n# tab completion - based on which\ncomplete -c catW -a \"(complete -C (printf %s\\n (commandline -ot)))\" -x\n```\n\n\u003c/p\u003e\u003c/details\u003e\n\n## `type -pa` Wrappers\n\nGenerate wrapper functions for executables or fish functions so that you don't\nhave to type out the following:\n\n```sh\nvim (type -p a-function.fish)\n```\n\nInstead, you can now run:\n\n```sh\nvimT a-function.fish\n```\n\n## `which` Wrappers\n\nGenerate wrapper functions for commands so that you don't have to type out the\nfollowing:\n\n```sh\nvim (which python-executable)\n```\n\nInstead, you can now run:\n\n```sh\nvimW python-executable\n```\n\n## `fd` / `find` Wrappers\n\nGenerate wrapper functions for commands such as the following:\n\n```sh\nvim (find path/for/find -iname \"*my-pat*\")\n```\n\nInstead, you can now run:\n\n```sh\nvimF my-pat path/for/find\n```\n\nBy default it uses the `find` executable. If you want to use [fd-find](https://github.com/sharkdp/fd) specify the `--fd` flag\n\n## TODO `grep -l` / `ripgrep` Wrappers\n\n## How can I add/remove to the list of executables to create wrappers for?\n\nJust edit the COMMANDS variable of the python script(s) and rerun.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbergercookie%2Ffish-function-wrappers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbergercookie%2Ffish-function-wrappers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbergercookie%2Ffish-function-wrappers/lists"}