{"id":13344254,"url":"https://github.com/keith/tag","last_synced_at":"2025-07-25T04:43:03.547Z","repository":{"id":27766378,"uuid":"105503663","full_name":"keith/tag","owner":"keith","description":"A helper for quickly opening matches in vim","archived":false,"fork":false,"pushed_at":"2024-12-17T00:16:02.000Z","size":76,"stargazers_count":24,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-09T03:20:44.106Z","etag":null,"topics":["bash","haskell","zsh"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-10-02T06:19:54.000Z","updated_at":"2024-12-17T00:15:38.000Z","dependencies_parsed_at":"2024-10-28T15:27:07.962Z","dependency_job_id":"9eaa53b1-a7a6-4314-af7b-04f34ea2d208","html_url":"https://github.com/keith/tag","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keith%2Ftag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keith%2Ftag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keith%2Ftag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keith%2Ftag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keith","download_url":"https://codeload.github.com/keith/tag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235053807,"owners_count":18928440,"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":["bash","haskell","zsh"],"created_at":"2024-07-29T19:32:53.562Z","updated_at":"2025-01-22T02:43:52.883Z","avatar_url":"https://github.com/keith.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tag\n\nTag is a wrapper CLI for [`ag`][ag], [`rg`][rg], `find`, and [`fd`][fd].\nIt parses the output and creates shell aliases to open vim at the\nlocations of the searches.\n\n## Examples\n\n```bash\n% rg foo\ntest/RgTests.hs\n[1] 11:65:  (Command \"rg\" [\"--heading\", \"--color\", \"always\", \"--column\", \"foo\"])\n[2] 12:16:  (rgCommand [\"foo\"])\n\ntest/AgTests.hs\n[3] 11:53:  (Command \"ag\" [\"--group\", \"--color\", \"--column\", \"foo\"])\n[4] 12:16:  (agCommand [\"foo\"])\n\n% e1 # This opens test/RgTests.hs in vim at line 11 column 65\n```\n\n```bash\n% fd yaml\n[1] stack.yaml\n[2] stack.yaml.lock\n\n% e1 # This opens stack.yaml in vim\n```\n\n## Installation\n\nOn macOS:\n\n```sh\n$ brew install keith/formulae/tag\n```\n\nManually:\n\n```sh\ncmake -B build\ncmake --build build\ncmake --install build\n```\n\n## Setup\n\nTag is meant to be a transparent wrapper around the underlying tools it\ncalls, in order to make this work, you need to add a bit of\nconfiguration to your shell to auto-source the aliases after running a\nsearch. Here's some example configurations for common shells.\n\n- `bash - ~/.bashrc`\n\n```bash\nif hash tag 2\u003e/dev/null; then\n  tag() {\n    trap 'source /tmp/tag_aliases 2\u003e/dev/null' SIGINT\n    command tag \"$@\" \u0026\u0026 source /tmp/tag_aliases 2\u003e/dev/null\n    trap - SIGINT\n  }\n  alias ag=\"tag ag\"\n  alias fd=\"tag fd\"\n  alias find=\"tag find\"\n  alias rg=\"tag rg\"\nfi\n```\n\n- `zsh - ~/.zshrc`\n\n```zsh\nif (( $+commands[tag] )); then\n  tag() {\n    trap 'source /tmp/tag_aliases 2\u003e/dev/null' SIGINT\n    command tag \"$@\" \u0026\u0026 source /tmp/tag_aliases 2\u003e/dev/null\n    trap - SIGINT\n  }\n  alias ag=\"tag ag\"\n  alias fd=\"tag fd\"\n  alias find=\"tag find\"\n  alias rg=\"tag rg\"\nfi\n```\n\nNOTE: With zsh tag also adds `fN` global aliases so you can use `cat f1`\nto print the file containing the first match.\n\n- `fish - ~/.config/fish/functions/tag.fish`\n\n```fish\nfunction tag\n  command tag $argv; and source /tmp/tag_aliases \u0026\u003e /dev/null\n  alias ag \"tag ag\"\n  alias fd \"tag fd\"\n  alias find \"tag find\"\n  alias rg \"tag rg\"\nend\n```\n\n## Configuration\n\nYou can customize the path tag writes the alias file to by passing\n`--alias-file /custom/path` before the tool.\n\n## Credits\n\nThis is inspired by [this project](https://github.com/aykamko/tag), I\nwanted to expand on it.\n\n[ag]: https://github.com/ggreer/the_silver_searcher\n[fd]: https://github.com/sharkdp/fd\n[rg]: https://github.com/BurntSushi/ripgrep\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeith%2Ftag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeith%2Ftag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeith%2Ftag/lists"}