{"id":16614715,"url":"https://github.com/randy3k/aligntab","last_synced_at":"2025-04-04T22:04:47.929Z","repository":{"id":5869181,"uuid":"7086462","full_name":"randy3k/AlignTab","owner":"randy3k","description":"An alignment plugin for Sublime Text using regular expression","archived":false,"fork":false,"pushed_at":"2021-11-16T17:52:44.000Z","size":1463,"stargazers_count":631,"open_issues_count":16,"forks_count":25,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-19T05:57:46.312Z","etag":null,"topics":["alignment","sublime-text"],"latest_commit_sha":null,"homepage":"","language":"Python","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/randy3k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-10T02:25:22.000Z","updated_at":"2024-09-17T15:30:03.000Z","dependencies_parsed_at":"2022-09-05T10:41:01.397Z","dependency_job_id":null,"html_url":"https://github.com/randy3k/AlignTab","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randy3k%2FAlignTab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randy3k%2FAlignTab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randy3k%2FAlignTab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randy3k%2FAlignTab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randy3k","download_url":"https://codeload.github.com/randy3k/AlignTab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256110,"owners_count":20909240,"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":["alignment","sublime-text"],"created_at":"2024-10-12T02:07:34.533Z","updated_at":"2025-04-04T22:04:47.909Z","avatar_url":"https://github.com/randy3k.png","language":"Python","readme":"# AlignTab\n\n\n[![test](https://github.com/randy3k/AlignTab/actions/workflows/test.yaml/badge.svg)](https://github.com/randy3k/AlignTab/actions/workflows/test.yaml)\n[![codecov](https://codecov.io/gh/randy3k/AlignTab/branch/master/graph/badge.svg)](https://codecov.io/gh/randy3k/AlignTab)\n\u003ca href=\"https://packagecontrol.io/packages/AlignTab\"\u003e\u003cimg src=\"https://packagecontrol.herokuapp.com/downloads/AlignTab.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.paypal.me/randy3k/5usd\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-blue.svg\" /\u003e\u003c/a\u003e\n\n\nThe most flexible alignment plugin for Sublime Text 3. This plugin is inspired by the excellent VIM plugin, [tabular](https://github.com/godlygeek/tabular).\n\nST2 support is deprecated but however, it is still possible to install AlignTab on ST2 via Package Control.\n\n\n## Features\n- Align using regular expression\n- Custom spacing, padding and justification.\n- Smart detection for alignment if no lines are selected\n- Multiple cursors support\n- Table mode and Live preview mode\n\n## Getting started\n\n- If you only want simple and quick alignment, the predefined alignment will help.\n\n\u003cimg width=650 src=\"https://user-images.githubusercontent.com/1690993/30779107-029a5934-a0b5-11e7-8523-7a3bb657b8f2.png\"\u003e\n\n## More complicated usage\n\n- Open `AlignTab` in Command Palette `C+Shift+p` and enter the input in the form of `\u003cregex\u003e/\u003coption\u003e`.\n- To learn more about regular expression, visit [here](http://www.regular-expressions.info) and [here](https://docs.python.org/2/library/re.html).\n- The option controls column justification, padding and maximum number of splits. A general syntax of options is `([rlc][0-9]*)*(f[0-9]*)?`.\n- The numbers after `r`, `c` or `l` determine how many spaces will be added after columns and the number after `f` controls how many matches will be made based `\u003cregex\u003e`.\n- For example, `c2r3f1` means\n  - first column is centered followed by 2 spaces\n  - second column is right-flushed followed by 3 spaces\n  - only the first match is used\n- If the number after `[rlc]` is omitted, 1 space will be added after each column.\n- If the number after `f` is omitted, only the first match will be used.\n- The entire option could be omitted (i.e., input only the regular expression). In that case, default option, `l1f0` will be used. It means:\n  - All columns are left-justified.\n  - A space is added after each column.\n  - All matched delimiters are aligned.\n\n\n## More about regex and options\n\n- Use non-capturing parenthese `(?:regex)` instread of capturing parenthese.\n- Delimiter is also treated as a column.\n  - For example, `=/rcl` means the the column before `=` will be right-justifed and the column after `=` will be left-justified. And `=` will be centered (however, it doesn't matter as `=` is of length 1).\n- The option for alignment cycles through the columns. \u003cbr\u003e\n  - For example, `regex/rl` means all odd columns will be right-justified and all even columns will be left-justified.\n- The symbol `*` repeats the preceeding justification flags.\n  - For example `r*3` equals `rrr`, and `(cr3)*2` equals `cr3cr3`.\n- (Experimental) Besides `r`, `c` and `l`, there is a new `u` flag which stands for \"unjustified\".\n\n## Live Preview Mode\n\n\u003cimg width=650 src=\"https://cloud.githubusercontent.com/assets/1690993/23576654/4d4fe048-0079-11e7-9fed-ece0850b1312.gif\"\u003e\n\n## Table Mode\n\n\u003cimg width=650 src=\"https://cloud.githubusercontent.com/assets/1690993/23576656/567bacec-0079-11e7-86ce-deaab5907acb.gif\"\u003e\n\nHit \u003ckbd\u003eESC\u003c/kbd\u003e or use the command `AlignTab: Exit Table Mode` to exit table mode.\n\n\n## Installation\n\n[Package Control](http://wbond.net/sublime_packages/package_control)\n\n\n## Examples\n\nSome simple examples. You can also contribute your examples [there](https://github.com/randy3k/AlignTab/wiki/Examples).\n\n## Keybinds\n\nIf you are interested in getting a keybind for live preview mode, add the following in your user keybinds file.\n```\n {\n   \"keys\": [\"super+shift+a\"], \"command\": \"align_tab\",\n   \"args\" : {\"live_preview\" : true}\n }\n```\n\n\nFor frequent patterns, you can consider the following in your user keybinds file. Change the keybind and the `user_input` for your purpose.\n\n```\n //align =\n  {\n    \"keys\": [\"super+shift+a\"], \"command\": \"align_tab\",\n    \"args\" : {\"user_input\" : \"=/f\"}\n  }\n```\n\nor syntex specific keybind.\n\n```\n  // latex align keybind, to align \u0026 and \\\\, but not \\\u0026\n    {\n    \t\"keys\": [\"super+shift+a\"], \"command\": \"align_tab\",\n        \"args\" : {\"user_input\" : \"(?\u003c!\\\\\\\\)\u0026|\\\\\\\\\\\\\\\\\"},\n        \"context\":[\n            { \"key\": \"selector\", \"operator\": \"equal\", \"operand\": \"text.tex.latex\" }\n        ]\n    }\n```\n\n\n\n## Named patterns\n\nTo make it easier to remember complex patterns, you can save them in a dictionary in the settings file. To edit the patterns, launch `Preferences: AlignTab Settings`. Use the name as key and the regex as value. For examples,\n\n```\n\"named_patterns\": {\n    \"eq\" : \"=/f\",\n    // right hand side could also be an array of inputs\n    \"ifthen\" : [\"=/f\", \"\\\\?/f\", \":/f\"]\n}\n```\n\nYou then just use the name instead of the pattern in the input field.\n\n## Custom Context Menu\n\nTo define new item in the context menu, launch `Preferences: AlignTab Context Menu` and add, for example\n\n```\n[\n   {\"caption\" : \"-\"},\n    {\n      \"id\": \"aligntab\",\n      \"caption\": \"AlignTab\",\n      \"children\": [\n          {\n          \"caption\" : \"{\",\n          \"command\" : \"align_tab\",\n          \"args\"    : {\"user_input\" : \"\\\\{\"}\n          }\n      ]\n  }\n]\n```\n\n\n## CJK Support\n\nAlignTab supoorts CJK characters, but you have to choose a correct font face and font size.\nTo my knowledge, `MinCho` works on all Chinese, Japanese and Korean.\n\n\u003cimg width=300 src=\"https://cloud.githubusercontent.com/assets/1690993/23576648/13fb5020-0079-11e7-9ffa-a10d5443192d.png\"\u003e\n\n## License\n\nAlignTab is licensed under the MIT License.\n","funding_links":["https://www.paypal.me/randy3k/5usd"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandy3k%2Faligntab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandy3k%2Faligntab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandy3k%2Faligntab/lists"}