{"id":20533631,"url":"https://github.com/echasnovski/mini.operators","last_synced_at":"2025-04-14T06:51:44.731Z","repository":{"id":188951163,"uuid":"678735716","full_name":"echasnovski/mini.operators","owner":"echasnovski","description":"Text edit operators. Part of 'mini.nvim' library. ","archived":false,"fork":false,"pushed_at":"2024-09-09T13:45:35.000Z","size":50,"stargazers_count":39,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-09T16:38:21.661Z","etag":null,"topics":["lua","mini-nvim","neovim","neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":false,"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/echasnovski.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":"2023-08-15T08:49:14.000Z","updated_at":"2024-09-09T13:45:38.000Z","dependencies_parsed_at":"2023-08-17T16:29:00.136Z","dependency_job_id":"dd8fb4e2-2f5d-43a8-bf22-3f7ea3ed4a68","html_url":"https://github.com/echasnovski/mini.operators","commit_stats":null,"previous_names":["echasnovski/mini.operators"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.operators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.operators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.operators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.operators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echasnovski","download_url":"https://codeload.github.com/echasnovski/mini.operators/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837274,"owners_count":21169373,"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":["lua","mini-nvim","neovim","neovim-plugin"],"created_at":"2024-11-16T00:22:52.833Z","updated_at":"2025-04-14T06:51:44.701Z","avatar_url":"https://github.com/echasnovski.png","language":"Lua","readme":"\u003cimg src=\"https://github.com/echasnovski/media/blob/main/mini.nvim/logo/logo_operators.png\" style=\"width: 100%\"\u003e\n\n\u003c!-- badges: start --\u003e\n[![GitHub license](https://badgen.net/github/license/echasnovski/mini.nvim)](https://github.com/echasnovski/mini.nvim/blob/main/LICENSE)\n\u003c!-- badges: end --\u003e\n\n### Text edit operators\n\nSee more details in [Features](#features) and [help file](doc/mini-operators.txt).\n\n---\n\n⦿ This is a part of [mini.nvim](https://github.com/echasnovski/mini.nvim) library. Please use [this link](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-operators.md) if you want to mention this module.\n\n⦿ All contributions (issues, pull requests, discussions, etc.) are done inside of 'mini.nvim'.\n\n⦿ See the repository page to learn about common design principles and configuration recipes.\n\n---\n\nIf you want to help this project grow but don't know where to start, check out [contributing guides of 'mini.nvim'](https://github.com/echasnovski/mini.nvim/blob/main/CONTRIBUTING.md) or leave a Github star for 'mini.nvim' project and/or any its standalone Git repositories.\n\n## Demo\n\nhttps://github.com/echasnovski/mini.nvim/assets/24854248/8a3656c4-c92a-4d9f-9711-8d6a751b3e5a\n\n## Features\n\nFeatures:\n- Operators:\n    - Evaluate text and replace with output.\n    - Exchange text regions.\n    - Multiply (duplicate) text.\n    - Replace text with register.\n    - Sort text.\n\n- Automated configurable mappings to operate on textobject, line, selection. Can be disabled in favor of more control with `MiniOperators.make_mappings()`.\n\n- All operators support `[count]` and dot-repeat.\n\nSee `*MiniOperators-overview*` and `*MiniOperators.config*` tags in help for more details.\n\n## Installation\n\nThis plugin can be installed as part of 'mini.nvim' library (**recommended**) or as a standalone Git repository.\n\nThere are two branches to install from:\n\n- `main` (default, **recommended**) will have latest development version of plugin. All changes since last stable release should be perceived as being in beta testing phase (meaning they already passed alpha-testing and are moderately settled).\n- `stable` will be updated only upon releases with code tested during public beta-testing phase in `main` branch.\n\nHere are code snippets for some common installation methods (use only one):\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ca href=\"https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-deps.md\"\u003emini.deps\u003c/a\u003e\u003c/summary\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eGithub repo\u003c/th\u003e\n            \u003cth\u003eBranch\u003c/th\u003e \u003cth\u003eCode snippet\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003e'mini.nvim' library\u003c/td\u003e \u003ctd\u003eMain\u003c/td\u003e \u003ctd rowspan=2\u003e\u003ci\u003eFollow recommended 'mini.deps' installation\u003c/i\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003eStandalone plugin\u003c/td\u003e \u003ctd\u003eMain\u003c/td\u003e \u003ctd\u003e\u003ccode\u003eadd('echasnovski/mini.operators')\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e \u003ctd\u003e\u003ccode\u003eadd({ source = 'echasnovski/mini.operators', checkout = 'stable' })\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ca href=\"https://github.com/folke/lazy.nvim\"\u003efolke/lazy.nvim\u003c/a\u003e\u003c/summary\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eGithub repo\u003c/th\u003e\n            \u003cth\u003eBranch\u003c/th\u003e \u003cth\u003eCode snippet\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003e'mini.nvim' library\u003c/td\u003e\n            \u003ctd\u003eMain\u003c/td\u003e \u003ctd\u003e\u003ccode\u003e{ 'echasnovski/mini.nvim', version = false },\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e \u003ctd\u003e\u003ccode\u003e{ 'echasnovski/mini.nvim', version = '*' },\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003eStandalone plugin\u003c/td\u003e\n            \u003ctd\u003eMain\u003c/td\u003e \u003ctd\u003e\u003ccode\u003e{ 'echasnovski/mini.operators', version = false },\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e \u003ctd\u003e\u003ccode\u003e{ 'echasnovski/mini.operators', version = '*' },\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ca href=\"https://github.com/junegunn/vim-plug\"\u003ejunegunn/vim-plug\u003c/a\u003e\u003c/summary\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eGithub repo\u003c/th\u003e\n            \u003cth\u003eBranch\u003c/th\u003e \u003cth\u003eCode snippet\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003e'mini.nvim' library\u003c/td\u003e\n            \u003ctd\u003eMain\u003c/td\u003e \u003ctd\u003e\u003ccode\u003ePlug 'echasnovski/mini.nvim'\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e \u003ctd\u003e\u003ccode\u003ePlug 'echasnovski/mini.nvim', { 'branch': 'stable' }\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=2\u003eStandalone plugin\u003c/td\u003e \u003ctd\u003eMain\u003c/td\u003e \u003ctd\u003e\u003ccode\u003ePlug 'echasnovski/mini.operators'\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e \u003ctd\u003e\u003ccode\u003ePlug 'echasnovski/mini.operators', { 'branch': 'stable' }\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n**Important**: don't forget to call `require('mini.operators').setup()` to enable its functionality.\n\n**Note**: if you are on Windows, there might be problems with too long file paths (like `error: unable to create file \u003csome file name\u003e: Filename too long`). Try doing one of the following:\n- Enable corresponding git global config value: `git config --system core.longpaths true`. Then try to reinstall.\n\n## Default config\n\n```lua\n-- No need to copy this inside `setup()`. Will be used automatically.\n{\n  -- Each entry configures one operator.\n  -- `prefix` defines keys mapped during `setup()`: in Normal mode\n  -- to operate on textobject and line, in Visual - on selection.\n\n  -- Evaluate text and replace with output\n  evaluate = {\n    prefix = 'g=',\n\n    -- Function which does the evaluation\n    func = nil,\n  },\n\n  -- Exchange text regions\n  exchange = {\n    prefix = 'gx',\n\n    -- Whether to reindent new text to match previous indent\n    reindent_linewise = true,\n  },\n\n  -- Multiply (duplicate) text\n  multiply = {\n    prefix = 'gm',\n\n    -- Function which can modify text before multiplying\n    func = nil,\n  },\n\n  -- Replace text with register\n  replace = {\n    prefix = 'gr',\n\n    -- Whether to reindent new text to match previous indent\n    reindent_linewise = true,\n  },\n\n  -- Sort text\n  sort = {\n    prefix = 'gs',\n\n    -- Function which does the sort\n    func = nil,\n  }\n}\n```\n\n## Similar plugins\n\n- [gbprod/substitute.nvim](https://github.com/gbprod/substitute.nvim)\n- [svermeulen/vim-subversive](https://github.com/svermeulen/vim-subversive)\n- [tommcdo/vim-exchange](https://github.com/tommcdo/vim-exchange)\n- [christoomey/vim-sort-motion](https://github.com/christoomey/vim-sort-motion)\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechasnovski%2Fmini.operators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechasnovski%2Fmini.operators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechasnovski%2Fmini.operators/lists"}