{"id":23320118,"url":"https://github.com/kg8m/vim-simple-align","last_synced_at":"2026-03-04T19:31:37.217Z","repository":{"id":53507023,"uuid":"343785492","full_name":"kg8m/vim-simple-align","owner":"kg8m","description":"A Vim/Neovim plugin to align texts by simple way, inspired by h1mesuke/vim-alignta","archived":false,"fork":false,"pushed_at":"2025-05-24T09:21:19.000Z","size":92,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T16:48:22.777Z","etag":null,"topics":["align","align-texts","delimiter","neovim","neovim-plugin","vim","vim-plugin","vim9-script"],"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/kg8m.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"kg8m"}},"created_at":"2021-03-02T13:33:39.000Z","updated_at":"2025-05-24T09:21:00.000Z","dependencies_parsed_at":"2023-01-19T16:45:26.775Z","dependency_job_id":"c4c4e471-57ec-424b-8113-16b9ee0ee995","html_url":"https://github.com/kg8m/vim-simple-align","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kg8m/vim-simple-align","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kg8m%2Fvim-simple-align","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kg8m%2Fvim-simple-align/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kg8m%2Fvim-simple-align/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kg8m%2Fvim-simple-align/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kg8m","download_url":"https://codeload.github.com/kg8m/vim-simple-align/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kg8m%2Fvim-simple-align/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30090520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T18:31:08.343Z","status":"ssl_error","status_checked_at":"2026-03-04T18:31:07.708Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["align","align-texts","delimiter","neovim","neovim-plugin","vim","vim-plugin","vim9-script"],"created_at":"2024-12-20T17:29:58.799Z","updated_at":"2026-03-04T19:31:37.100Z","avatar_url":"https://github.com/kg8m.png","language":"Vim Script","funding_links":["https://github.com/sponsors/kg8m"],"categories":[],"sub_categories":[],"readme":"[![Vim 8.2+](https://img.shields.io/badge/Vim-Support%208.2%2B-yellowgreen.svg?logo=vim)](https://github.com/vim/vim/tree/v8.2.0000)\n[![Neovim nightly](https://img.shields.io/badge/Neovim-Support%20nightly-yellowgreen.svg?logo=neovim\u0026logoColor=white)](https://github.com/neovim/neovim)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![test](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml/badge.svg)](https://github.com/kg8m/vim-simple-align/actions/workflows/test.yml)\n\n# vim-simple-align\n\nA Vim/Neovim plugin to align texts by simple way.\n\n- vim-simple-align provides only 1 command and a few its options\n  - no need to remember options because they can be completed\n- delimiter used to split texts is always Vim's regular expression\n\nvim-simple-align doesn't cover all alignment cases but aims to work nice in many common cases.\n\nhttps://user-images.githubusercontent.com/694547/119252181-beec6380-bbe5-11eb-87ce-4ed643598962.mp4\n\n## Commands/Usage\n\nvim-simple-align provides only 1 command: `:SimpleAlign`.\n\nUsage:\n\n```vim\n:{RANGE}SimpleAlign {DELIMITER}\n```\n\nOr\n\n```vim\n:{RANGE}SimpleAlign {DELIMITER} {OPTIONS}\n```\n\nDelimiter is Vim's regular expression. Some characters may need to be escaped.\n\ncf. `:h regular-expression`\n\n### Options\n\n#### `-count` (`-c`) option\n\n`-count` option means how many times to split and align tokens. Available values are `-1` and integers greater than 0. `-1` means unlimited.\n\nDefault: `-1`\n\n#### `-lpadding` (`-l`) option\n\n`-lpadding` option means how many spaces to put left padding of each token. Available values are integers greater than or equal to 0.\n\nDefault: `1`\n\n#### `-rpadding` (`-r`) option\n\n`-rpadding` option means how many spaces to put right padding of each token. Available values are integers greater than or equal to 0.\n\nDefault: `1`\n\n#### `-justify` (`-j`) option\n\n`-justify` option means which side tokens should be on. Available values are `left` and `right`.\n\nDefault: `left`\n\n## Examples\n\n### Align Markdown table\n\n#### ❌ Not aligned\n\n```md\na | bbb | ccccc\n--- | --- | ---\n012345 | 6 | 789\n.. | .. | ..\n```\n\n```md\n| a | bbb | ccccc |\n| --- | --- | --- |\n| 012345 | 6 | 789 |\n| .. | .. | .. |\n```\n\n#### 🔧 Command\n\n```vim\n:1,4SimpleAlign |\n```\n\n#### ⭕️ Aligned\n\n```md\na      | bbb | ccccc\n---    | --- | ---\n012345 | 6   | 789\n..     | ..  | ..\n```\n\n```md\n| a      | bbb | ccccc |\n| ---    | --- | ---   |\n| 012345 | 6   | 789   |\n| ..     | ..  | ..    |\n```\n\n### Align Markdown table with justifying to right\n\n#### ❌ Not aligned\n\n```md\na | bbb | ccccc\n--- | --- | ---\n012345 | 6 | 789\n.. | .. | ..\n```\n\n```md\n| a | bbb | ccccc |\n| --- | --- | --- |\n| 012345 | 6 | 789 |\n| .. | .. | .. |\n```\n\n#### 🔧 Command\n\n```vim\n:1,4SimpleAlign | -justify right\n```\n\n#### ⭕️ Aligned\n\n```md\n     a | bbb | ccccc\n   --- | --- |   ---\n012345 |   6 |   789\n    .. |  .. |    ..\n```\n\n```md\n|      a | bbb | ccccc |\n|    --- | --- |   --- |\n| 012345 |   6 |   789 |\n|     .. |  .. |    .. |\n```\n\n### Align JSON, dictionary/hash items\n\n#### ❌ Not aligned\n\nJSON:\n\n```json\n{\n  \"a\": \"a\",\n  \"bbb\": \"bbb\",\n  \"ccccc\": \"ccccc\"\n}\n```\n\nJavaScript dictionary:\n\n```js\n{\n  a: \"a\",\n  bbb: \"bbb\",\n  ccccc: \"ccccc\",\n}\n```\n\nRuby old Hash syntax:\n\n```rb\n{\n  \"a\" =\u003e \"a\",\n  \"bbb\" =\u003e \"bbb\",\n  \"ccccc\" =\u003e \"ccccc\",\n}\n```\n\n#### 🔧 Command\n\nFor JSON:\n\n```vim\n:2,4SimpleAlign [^:\\ ]\\+:\n```\n\nFor JavaScript dictionary:\n\n```vim\n:2,4SimpleAlign \\w\\+:\n```\n\nFor Ruby old Hash syntax:\n\n```vim\n:2,4SimpleAlign =\u003e\n```\n\n#### ⭕️ Aligned\n\nJSON:\n\n```json\n{\n  \"a\":     \"a\",\n  \"bbb\":   \"bbb\",\n  \"ccccc\": \"ccccc\"\n}\n```\n\nJavaScript dictionary:\n\n```js\n{\n  a:     \"a\",\n  bbb:   \"bbb\",\n  ccccc: \"ccccc\",\n}\n```\n\nRuby old Hash syntax:\n\n```rb\n{\n  \"a\"     =\u003e \"a\",\n  \"bbb\"   =\u003e \"bbb\",\n  \"ccccc\" =\u003e \"ccccc\",\n}\n```\n\n### Align variable assignments\n\n#### ❌ Not aligned\n\nBasic case:\n\n```js\nconst a = \"a\";\nconst bbb = \"bbb\";\nconst ccccc = \"ccccc\";\n```\n\nCase when multiple `=`s exist:\n\n```js\nconst a = \"a\";\nconst bbb = \"bbb\";\nconst ccccc = \"ccccc\";\nconst d = (a === bbb)\n```\n\n`=` and `+=`:\n\n```rb\na = \"a\"\na += \"a\"\n```\n\n#### 🔧 Command\n\nFor basic case:\n\n```vim\n:1,3SimpleAlign =\n```\n\nFor the case when multiple `=`s exist:\n\n```vim\n:1,4SimpleAlign = -count 1\n```\n\nFor `=` and `+=`:\n\n```vim\n:1,2SimpleAlign [+\\ ]=\n```\n\n#### ⭕️ Aligned\n\nBasic case:\n\n```js\nconst a     = \"a\";\nconst bbb   = \"bbb\";\nconst ccccc = \"ccccc\";\n```\n\nCase when multiple `=`s exist:\n\n```js\nconst a     = \"a\";\nconst bbb   = \"bbb\";\nconst ccccc = \"ccccc\";\nconst d     = (a === bbb)\n```\n\n`=` and `+=`:\n\n```rb\na  = \"a\"\na += \"a\"\n```\n\n### Align output/result comments\n\n#### ❌ Not aligned\n\nJavaScript:\n\n```js\na() //=\u003e \"a\"\nbbb() //=\u003e \"bbb\"\nccccc() //=\u003e \"ccccc\"\n```\n\nRuby:\n\n```rb\na #=\u003e \"a\"\nbbb #=\u003e \"bbb\"\nccccc #=\u003e \"ccccc\"\n```\n\n#### 🔧 Command\n\nFor JavaScript:\n\n```vim\n:1,3SimpleAlign //=\u003e -lpadding 2\n```\n\nFor Ruby:\n\n```vim\n:1,3SimpleAlign #=\u003e -lpadding 2\n```\n\n#### ⭕️ Aligned\n\nJavaScript:\n\n```js\na()      //=\u003e \"a\"\nbbb()    //=\u003e \"bbb\"\nccccc()  //=\u003e \"ccccc\"\n```\n\nRuby:\n\n```rb\na      #=\u003e \"a\"\nbbb    #=\u003e \"bbb\"\nccccc  #=\u003e \"ccccc\"\n```\n\n### Align non-whitespace characters\n\n#### ❌ Not aligned\n\n```rb\nt.belongs_to :user, null: false\nt.string :name, null: false\nt.boolean :active, null: false, default: true\nt.boolean :foo, null: true, default: false\n```\n\n#### 🔧 Command\n\n```vim\n:1,4SimpleAlign \\S\\+ -lpadding 0\n```\n\n#### ⭕️ Aligned\n\n```rb\nt.belongs_to :user,   null: false\nt.string     :name,   null: false\nt.boolean    :active, null: false, default: true\nt.boolean    :foo,    null: true,  default: false\n```\n\n## Inspired by alignta\n\nvim-simple-align is inspired by [h1mesuke/vim-alignta](https://github.com/h1mesuke/vim-alignta). It is a simple Vim plugin to align texts. It provides only 1 command `:Alignta` and has a few options and command syntaxes. It is a very great plugin but doesn't work on current Vim. vim-simple-align inherits its philosophy and focuses its limited essential features.\n\n## Why not vim-easy-align?\n\nYes, [vim-easy-align](https://github.com/junegunn/vim-easy-align) is a great Vim plugin. However, it is complicated and difficult for me. I can't remember its mappings, options, and syntaxes. It is a so cool product, but not for me.\n\n## Installation\n\nIf you use [dein.vim](https://github.com/Shougo/dein.vim):\n\n```vim\ncall dein#add(\"kg8m/vim-simple-align\")\n```\n\nNote: dein.vim's lazy loading feature with `on_cmd` option is not recommended for vim-simple-align. You will see `E471: Argument required: ...` if so. To tell the truth, lazy loading of vim-simple-align doesn't make Vim's startup faster. On the one hand, vim-simple-align just defines 1 command when added to `runtimepath`. On the other hand, dein.vim's lazy loading with `on_cmd` also defines a dummy command.\n\n## Vim9 script\n\nYou can use Vim9 script version if you use Vim 8.2.4053+. Vim9 script version is 5-10 times faster than legacy Vim script version. Vim9 script version is available on [`vim9` branch](https://github.com/kg8m/vim-simple-align/tree/vim9).\n\n```vim\ncall dein#add(\"kg8m/vim-simple-align\", { \"rev\": \"vim9\" })\n```\n\n## Requirements\n\nVim 8.2+ or Neovim nightly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkg8m%2Fvim-simple-align","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkg8m%2Fvim-simple-align","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkg8m%2Fvim-simple-align/lists"}