{"id":20533766,"url":"https://github.com/echasnovski/mini.splitjoin","last_synced_at":"2025-04-14T06:52:41.321Z","repository":{"id":161480304,"uuid":"611646284","full_name":"echasnovski/mini.splitjoin","owner":"echasnovski","description":"Neovim Lua plugin to split and join arguments. Part of 'mini.nvim' library. ","archived":false,"fork":false,"pushed_at":"2025-01-31T13:45:15.000Z","size":43,"stargazers_count":58,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T20:40:33.467Z","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-03-09T08:56:27.000Z","updated_at":"2025-03-07T16:52:25.000Z","dependencies_parsed_at":"2023-11-17T16:46:10.484Z","dependency_job_id":"d55995d8-6615-4373-aa75-34a9a82039db","html_url":"https://github.com/echasnovski/mini.splitjoin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.splitjoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.splitjoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.splitjoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echasnovski%2Fmini.splitjoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echasnovski","download_url":"https://codeload.github.com/echasnovski/mini.splitjoin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837275,"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:23:40.387Z","updated_at":"2025-04-14T06:52:41.294Z","avatar_url":"https://github.com/echasnovski.png","language":"Lua","readme":"\u003cimg src=\"https://github.com/echasnovski/media/blob/main/mini.nvim/logo/logo_splitjoin.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### Split and join arguments\n\nSee more details in [Features](#features) and [help file](doc/mini-splitjoin.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-splitjoin.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://user-images.githubusercontent.com/24854248/223969793-e0e461ff-5a98-444f-9bc3-7b490ebfe59e.mp4\n\n## Features\n\n- Mappings and Lua functions that modify arguments (regions inside brackets between allowed separators) under cursor.\n\n  Supported actions:\n    - Toggle - split if arguments are on single line, join otherwise. Main supported function of the module. See `MiniSplitjoin.toggle()` in help file.\n    - Split - make every argument separator be on end of separate line. See `MiniSplitjoin.split()` in help file.\n    - Join - make all arguments be on single line. See `MiniSplitjoin.join()` in help file.\n\n- Mappings are dot-repeatable in Normal mode and work in Visual mode.\n\n- Customizable argument detection (see `MiniSplitjoin.config.detect` in help file):\n    - Which brackets can contain arguments.\n    - Which strings can separate arguments.\n    - Which regions exclude when looking for separators (like inside nested brackets or quotes).\n\n- Customizable pre and post hooks for both split and join. See `split` and `join` of `MiniSplitjoin.config` in help file.\n\n- Works inside comments by using modified notion of indent. See `MiniSplitjoin.get_indent_part()` in help file.\n\n- Provides low-level Lua functions for split and join at positions. See `MiniSplitjoin.split_at()` and `MiniSplitjoin.join_at()` in help file.\n\nNotes:\n- Search for arguments is done using Lua patterns (regex-like approach). Certain amount of false positives is to be expected.\n\n- This module is mostly designed around `MiniSplitjoin.toggle()`. If initial split positions are on different lines, join first and then split.\n\n- Actions can be done on Visual mode selection, which mostly present as a safety route in case of incorrect detection of initial region. It uses `MiniSplitjoin.get_visual_region()` which treats selection as full brackets (use `va)` and not `vi)`).\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.splitjoin')\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.splitjoin', 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.splitjoin', 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.splitjoin', 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.splitjoin'\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.splitjoin', { '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.splitjoin').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- Install plugin in other place with shorter path.\n\n## Default config\n\n```lua\n-- No need to copy this inside `setup()`. Will be used automatically.\n{\n  -- Module mappings. Use `''` (empty string) to disable one.\n  -- Created for both Normal and Visual modes.\n  mappings = {\n    toggle = 'gS',\n    split = '',\n    join = '',\n  },\n\n  -- Detection options: where split/join should be done\n  detect = {\n    -- Array of Lua patterns to detect region with arguments.\n    -- Default: { '%b()', '%b[]', '%b{}' }\n    brackets = nil,\n\n    -- String Lua pattern defining argument separator\n    separator = ',',\n\n    -- Array of Lua patterns for sub-regions to exclude separators from.\n    -- Enables correct detection in presence of nested brackets and quotes.\n    -- Default: { '%b()', '%b[]', '%b{}', '%b\"\"', \"%b''\" }\n    exclude_regions = nil,\n  },\n\n  -- Split options\n  split = {\n    hooks_pre = {},\n    hooks_post = {},\n  },\n\n  -- Join options\n  join = {\n    hooks_pre = {},\n    hooks_post = {},\n  },\n}\n```\n\n## Similar plugins\n\n- [FooSoft/vim-argwrap](https://github.com/FooSoft/vim-argwrap)\n- [AndrewRadev/splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim)\n- [Wansmer/treesj](https://github.com/Wansmer/treesj)\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechasnovski%2Fmini.splitjoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechasnovski%2Fmini.splitjoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechasnovski%2Fmini.splitjoin/lists"}