{"id":19263550,"url":"https://github.com/trapd00r/yankmatches.vim","last_synced_at":"2025-06-15T14:09:38.261Z","repository":{"id":137111220,"uuid":"487077919","full_name":"trapd00r/yankmatches.vim","owner":"trapd00r","description":"A Vim plugin that allows for yanking or deleting the results of a previously performed search action","archived":false,"fork":false,"pushed_at":"2024-06-08T08:05:55.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T19:13:47.408Z","etag":null,"topics":["vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim script","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/trapd00r.png","metadata":{"files":{"readme":"README.mkd","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":"2022-04-29T18:45:41.000Z","updated_at":"2022-05-01T16:59:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"2becc8a1-5ded-42c1-9aca-2539e45f99d3","html_url":"https://github.com/trapd00r/yankmatches.vim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trapd00r/yankmatches.vim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2Fyankmatches.vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2Fyankmatches.vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2Fyankmatches.vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2Fyankmatches.vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trapd00r","download_url":"https://codeload.github.com/trapd00r/yankmatches.vim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2Fyankmatches.vim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259987100,"owners_count":22942118,"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":["vim","vim-plugin"],"created_at":"2024-11-09T19:36:10.775Z","updated_at":"2025-06-15T14:09:38.214Z","avatar_url":"https://github.com/trapd00r.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"## yankmatches.vim\n\nThis plugin was originally made by Damian Conway.\n\nIt allows you to perform various magic operations on the result of a previous\n`/search` (or any other search operation, like `*`).\n\nI have added a few things:\n\n* A `YankMatches` highlight group that you can use to visualize what lines you've\n  just yanked\n* Added ability to configure what register to use for yanking/deleting `YankMatches#ClipboardRegister`; thank you [joshukraine](https://github.com/joshukraine/yankmatches/blob/e88fa4e21ac12059f3a6c51709baebb3dbec454d/plugin/yankmatches.vim#L83)\n* Tweaked so that `hlsearch` can still be active\n\nExamples:\n\nExtract all lines matching a `/cats` search operation for pasting somewhere else for further investigation:\n\n```vim\n/cats\u003ccr\u003e\n\u003cleader\u003eym\nGp\n```\n\nNow you will find all cats copied to the bottom of the buffer.\n\n\nOpen a `vim` file, like your `.vimrc`:\n\n```vim\n/^\\s*\".*$\n\u003cleader\u003eDM\n```\n\nNow you will find that everything but the comments in your file is deleted.\n\nIf you wanted to delete only the comments, the operation would be:\n\n```vim\n/^\\s*\".*$\n\u003cleader\u003edm\n```\n\n\n### Installation\n\nThrow the plugin into your `$VIMRUNTIME/plugin` directory, i.e `~/.vim/plugin/`.\n\n### Configuration\n\n#### Mappings\n\n##### Normal mode mappings\n\n```vim\n\u003cleader\u003edm \" delete all matches\n\u003cleader\u003eDM \" delete everything that does NOT match\n\u003cleader\u003eym \" yank all matches\n\u003cleader\u003eYM \" yank everything that does NOT match\n```\n\n##### Visual mode mappings\n\n```vim\n\u003cleader\u003edm \" delete matches, but limited to matches inside a visual selection\n\u003cleader\u003eDM \" delete everything that does NOT match, but limited to (not) matches\n           \" inside a visual selection\n\u003cleader\u003eym \" yank matches, but limited to matches inside a visual selection\n\u003cleader\u003eYM \" yank everything that does NOT match, but limited to (not) matches\n           \" inside a visual selection\n\n```\n##### Yanking register\nBy default, the value of `\u0026clipboard` is used for the yanking/deleting\noperations. This can however be overridden:\n\n```vim\nlet g:YankMatches#ClipboardRegister = '*'\n\n```\n\n##### Additional mappings\n\nThough not provided by default, you are suggested to modify your current\n`:nohlsearch` mapping to account for the `YankMatches` as well.\n\nThe author uses this mapping:\n\n```vim\n\" remove hlsearch, hlnext, matches, highlighted yanks, highlighted lines and redraw screen\nnnoremap \u003csilent\u003e \u003cC-l\u003e :call HLNextOff() \u003cBAR\u003e :nohlsearch \u003cBAR\u003e :hi clear YankedMatches \u003cBAR\u003e :call HighlightCurrentLine('clear')\u003ccr\u003e\n\n```\n\n#### Colors\n\nThese are the default colors defined for the `YankMatches` highlight group, but\nyou are free to override as you see fit.\n\n```vim\nhighlight YankedMatches\n  \\ ctermfg=bg ctermbg=214 cterm=bolditalic\n  \\ guifg=bg guibg=#ffaf00 gui=none\n```\n\n### Screenshot\n\n![screenshot](./extra/screenshot.png?raw=true)\n\nWhat you see in the screenshot above: \n\n* A search has been performed, `/line_\\S\\+`\n* `\u003cleader\u003eym` has been executed\n* The statusline displays the number of lines yanked, in this case 10\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapd00r%2Fyankmatches.vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrapd00r%2Fyankmatches.vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapd00r%2Fyankmatches.vim/lists"}