{"id":13898316,"url":"https://github.com/jesseleite/vim-agriculture","last_synced_at":"2025-07-18T07:03:28.162Z","repository":{"id":29875682,"uuid":"123048861","full_name":"jesseleite/vim-agriculture","owner":"jesseleite","description":"🚜 Vim plugin to improve project searching with tools like ag and rg","archived":false,"fork":false,"pushed_at":"2024-05-12T16:29:43.000Z","size":31,"stargazers_count":140,"open_issues_count":7,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T15:22:32.765Z","etag":null,"topics":["ack","ag","fzf","search","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim script","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/jesseleite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"jesseleite"}},"created_at":"2018-02-27T00:23:32.000Z","updated_at":"2025-03-22T21:07:20.000Z","dependencies_parsed_at":"2024-10-26T21:14:13.313Z","dependency_job_id":"4f6a00df-8014-4934-8f60-cb841a06a9cd","html_url":"https://github.com/jesseleite/vim-agriculture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jesseleite/vim-agriculture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesseleite%2Fvim-agriculture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesseleite%2Fvim-agriculture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesseleite%2Fvim-agriculture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesseleite%2Fvim-agriculture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jesseleite","download_url":"https://codeload.github.com/jesseleite/vim-agriculture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesseleite%2Fvim-agriculture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265716306,"owners_count":23816354,"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":["ack","ag","fzf","search","vim"],"created_at":"2024-08-06T18:04:13.756Z","updated_at":"2025-07-18T07:03:28.114Z","avatar_url":"https://github.com/jesseleite.png","language":"Vim script","funding_links":["https://github.com/sponsors/jesseleite"],"categories":["Vim Script"],"sub_categories":[],"readme":"# Vim Agriculture 🚜\n\nA vim plugin to improve the project search experience when using tools like [ag](https://github.com/ggreer/the_silver_searcher) and [rg](https://github.com/BurntSushi/ripgrep).\n\n- [Rationale](#rationale)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Mappings](#mappings)\n- [Customization](#customization)\n- [How It Works](#how-it-works)\n\n## Rationale\n\nI was inspired by [fzf.vim](https://github.com/junegunn/fzf.vim)'s ability to quickly `:Ag` search multiple words without quotes, narrow down multiple results in realtime with [extended search syntax](https://github.com/junegunn/fzf#search-syntax), then populate quickfix for a large refactor 👌\n\n```\n:Ag function index\n```\n\nBut I found myself missing the ability to pass command line options like I could with [ack.vim](https://github.com/mileszs/ack.vim)'s `:Ack` 😢\n\n```\n:Ack -Q -i 'function index' vendor\n```\n\nFurthermore, fzf.vim's `:Ag` treats quotes as a literal part of the search query, which is inconsistent with `ag` on the command line.\n\nThus, the intention of this plugin is to bring the best of both worlds to your favourite search wrapper.  Perform multi-word searches with or without quotes, pass command line options, and do it all from one command.\n\n[Read more about my project searching workflow with fzf.vim and agriculture](https://jesseleite.com/posts/4/project-search-your-feelings) ❤️\n\n## Installation\n\nInstall using [vim-plug](https://github.com/junegunn/vim-plug) or similar:\n\n```\nPlug 'jesseleite/vim-agriculture'\n```\n\n## Usage\n\nIf you are already using [fzf.vim](https://github.com/junegunn/fzf.vim), you can use the provided `:AgRaw` / `:RgRaw` commands.\n\n```\n:AgRaw func.*index\n:AgRaw 'func.*index'\n:AgRaw -Q 'function index()' app/Http/Controllers\n```\n\nLikewise for `:RgRaw`, just substitute `AgRaw` in `RgRaw` in the above examples.\n\nIf you are using another search wrapper, you'll need to wrap your input with `agriculture#smart_quote_input()`.\n\n## Mappings\n\nIf you are using one of the provided commands, you can hook into the provided `\u003cPlug\u003e` mappings in your `.vimrc`:\n\n```\nnmap \u003cLeader\u003e/ \u003cPlug\u003eAgRawSearch\nvmap \u003cLeader\u003e/ \u003cPlug\u003eAgRawVisualSelection\nnmap \u003cLeader\u003e* \u003cPlug\u003eAgRawWordUnderCursor\n```\n\nLikewise for `:RgRaw`, just substitute `AgRaw` in `RgRaw` in the above examples.\n\n## Customization\n\n### Command Line Options\n\nIf you are using one of the provided commands, you can also set default command line options in your `.vimrc`:\n\n```\nlet g:agriculture#ag_options = '--case-sensitive'\n```\n\nAgain likewise for `:RgRaw` with `g:agriculture#rg_options`.\n\n### Disable Smart Quoting\n\nIf you are using one of the provided commands, and want to disable smart quoting for CLI consistency:\n\n```\nlet g:agriculture#disable_smart_quoting = 1\n```\n\n### Preview Window\n\nPreview windows are now rendered by default in many [fzf.vim](https://github.com/junegunn/fzf.vim) commands.  If you wish to customize or disable this behaviour, [see fzf.vim's documentation](https://github.com/junegunn/fzf.vim#preview-window) on preview windows.\n\n## How It Works\n\nYour input will be automatically quoted _unless_ the following conditions are met:\n   - Quotes in your query, signifying you might want to handle your own quoting/escaping, ie.\n      ```\n      :Ag -Q \"Already quoted this pattern.\"\n      :Ag Why you \"scruffy looking nerf herder\"!\n      :Ag Who's scruffy looking?\n      ```\n   - A space followed by a dash in your query, signifying you might be passing an option, ie.\n      ```\n      :Ag -Q function index\n      :Ag Which way to the beach? -\u003e that way!\n      ```\n   - An escaped pattern followed by an unescaped space, signifying you might be passing a path, ie.\n      ```\n      :Ag an\\ escaped\\ pattern vendor/folder\n      ```\n\nTL;DR: If you use quotes, dashes, or need to pass a path, it's recommended you quote/escape your own pattern and vim-agriculture will stay out of your way 👍\n\n## Who am I?\n\nJust a hack 🔨\n\n- [jesseleite.com](https://jesseleite.com)\n- [@jesseleite85](https://twitter.com/jesseleite85)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesseleite%2Fvim-agriculture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesseleite%2Fvim-agriculture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesseleite%2Fvim-agriculture/lists"}