{"id":13451638,"url":"https://github.com/dhruvasagar/vim-table-mode","last_synced_at":"2025-05-15T08:08:04.224Z","repository":{"id":7475719,"uuid":"8823857","full_name":"dhruvasagar/vim-table-mode","owner":"dhruvasagar","description":"VIM Table Mode for instant table creation.","archived":false,"fork":false,"pushed_at":"2024-03-13T18:39:35.000Z","size":1592,"stargazers_count":2152,"open_issues_count":29,"forks_count":97,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-04T13:18:05.886Z","etag":null,"topics":["hacktoberfest","table","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/dhruvasagar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"dhruvasagar","patreon":null,"open_collective":"vim-table-mode","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2013-03-16T19:01:28.000Z","updated_at":"2025-05-03T16:17:39.000Z","dependencies_parsed_at":"2023-12-25T21:44:14.056Z","dependency_job_id":"cfabb9f1-4097-4889-809d-20fc44861559","html_url":"https://github.com/dhruvasagar/vim-table-mode","commit_stats":{"total_commits":315,"total_committers":28,"mean_commits":11.25,"dds":"0.16190476190476188","last_synced_commit":"4ff8de2ac93431ee6d85a9e04177012752e6abdc"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvasagar%2Fvim-table-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvasagar%2Fvim-table-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvasagar%2Fvim-table-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvasagar%2Fvim-table-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruvasagar","download_url":"https://codeload.github.com/dhruvasagar/vim-table-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252337854,"owners_count":21731852,"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":["hacktoberfest","table","vim","vim-plugin"],"created_at":"2024-07-31T07:00:57.579Z","updated_at":"2025-05-04T13:18:11.702Z","avatar_url":"https://github.com/dhruvasagar.png","language":"Vim Script","readme":"# VIM Table Mode v4.8.1 [![Build](https://github.com/dhruvasagar/vim-table-mode/actions/workflows/ci.yml/badge.svg)](https://github.com/dhruvasagar/vim-table-mode/actions/workflows/ci.yml)\n\nAn awesome automatic table creator \u0026 formatter allowing one to create neat\ntables as you type.\n\n## Getting Started\n\n### Installation\n\n#### \u003ca href=\"https://www.danielfranklin.id.au/vim-8-package-management/\"\u003eVim 8+ native package manager\u003c/a\u003e\n\nclone into `.vim/pack/plugins/start` (the `plugins` folder can have any name)\n\nAdd `packloadall` in your `~/.vimrc`.\n\n#### \u003ca href=\"https://github.com/Shougo/neobundle.vim\"\u003eNeoBundle\u003c/a\u003e\n\nAdd `NeoBundle 'dhruvasagar/vim-table-mode'` to your `~/.vimrc`.\n\n#### \u003ca href=\"https://github.com/tpope/vim-pathogen\"\u003epathogen.vim\u003c/a\u003e\n\nAdd a git submodule for your plugin:\n\n```sh\n$ cd ~/.vim\n$ git submodule add git@github.com:dhruvasagar/vim-table-mode.git bundle/table-mode\n```\n\nCopy all files under `autoload/`, `plugin/`, and `doc/` to respective\n`~/.vim/autoload/`, `~/.vim/plugin` and `~/.vim/doc` under UNIX, or\n`vimfiles/autoload/`, `vimfiles/plugin/` and `vimfiles/doc` under WINDOWS and\nrestart Vim.\n\n#### \u003ca href=\"https://github.com/junegunn/vim-plug\"\u003evim-plug\u003c/a\u003e\n\nAdd `Plug 'dhruvasagar/vim-table-mode'` to your `~/.vimrc`.\n\n### Creating table on-the-fly\n\nTo start using the plugin in the on-the-fly mode use `:TableModeToggle` mapped to \u003ckbd\u003e\\\u003cLeader\\\u003etm\u003c/kbd\u003e by default (which means \u003ckbd\u003e\\\\\u003c/kbd\u003e \u003ckbd\u003et\u003c/kbd\u003e \u003ckbd\u003em\u003c/kbd\u003e if you didn't override the \u003cLeader\u003e by `:let mapleader = ','` to have \u003ckbd\u003e,\u003c/kbd\u003e \u003ckbd\u003et\u003c/kbd\u003e \u003ckbd\u003em\u003c/kbd\u003e).\n\nTip:\nYou can use the following to quickly enable / disable table mode in insert mode by using `||` or `__`:\n\n\u003e ```vim\n\u003e function! s:isAtStartOfLine(mapping)\n\u003e   let text_before_cursor = getline('.')[0 : col('.')-1]\n\u003e   let mapping_pattern = '\\V' . escape(a:mapping, '\\')\n\u003e   let comment_pattern = '\\V' . escape(substitute(\u0026l:commentstring, '%s.*$', '', ''), '\\')\n\u003e   return (text_before_cursor =~? '^' . ('\\v(' . comment_pattern . '\\v)?') . '\\s*\\v' . mapping_pattern . '\\v$')\n\u003e endfunction\n\u003e\n\u003e inoreabbrev \u003cexpr\u003e \u003cbar\u003e\u003cbar\u003e\n\u003e           \\ \u003cSID\u003eisAtStartOfLine('\\|\\|') ?\n\u003e           \\ '\u003cc-o\u003e:TableModeEnable\u003ccr\u003e\u003cbar\u003e\u003cspace\u003e\u003cbar\u003e\u003cleft\u003e\u003cleft\u003e' : '\u003cbar\u003e\u003cbar\u003e'\n\u003e inoreabbrev \u003cexpr\u003e __\n\u003e           \\ \u003cSID\u003eisAtStartOfLine('__') ?\n\u003e           \\ '\u003cc-o\u003e:silent! TableModeDisable\u003ccr\u003e' : '__'\n\u003e ```\n\nEnter the first line, delimiting columns by the `|` symbol. The plugin reacts by inserting spaces between the text and the separator if you omit them:\n\n    | name | address | phone |\n\nIn the second line (without leaving Insert mode), enter `|` twice. The plugin will write a properly formatted horizontal line:\n\n    | name | address | phone |\n    |------+---------+-------|\n\nWhen you enter the subsequent lines, the plugin will automatically adjust the formatting to match the text you’re entering every time you press `|`:\n\n    | name       | address | phone |\n    |------------+---------+-------|\n    | John Adams |\n\nGo on until the table is ready:\n\n    | name            | address                  | phone      |\n    |-----------------+--------------------------+------------|\n    | John Adams      | 1600 Pennsylvania Avenue | 0123456789 |\n    |-----------------+--------------------------+------------|\n    | Sherlock Holmes | 221B Baker Street        | 0987654321 |\n    |-----------------+--------------------------+------------|\n\nThen you can return to the first line and above it enter `||`:\n\n    |-----------------+--------------------------+------------|\n    | name            | address                  | phone      |\n    |-----------------+--------------------------+------------|\n    | John Adams      | 1600 Pennsylvania Avenue | 0123456789 |\n    |-----------------+--------------------------+------------|\n    | Sherlock Holmes | 221B Baker Street        | 0987654321 |\n    |-----------------+--------------------------+------------|\n\nCorner separators are adjustable:\n\nFor Markdown-compatible tables use\n\n    let g:table_mode_corner='|'\n\n\n    |-----------------|--------------------------|------------|\n    | name            | address                  | phone      |\n    |-----------------|--------------------------|------------|\n    | John Adams      | 1600 Pennsylvania Avenue | 0123456789 |\n    |-----------------|--------------------------|------------|\n    | Sherlock Holmes | 221B Baker Street        | 0987654321 |\n    |-----------------|--------------------------|------------|\n\nTo get ReST-compatible tables use\n\n    let g:table_mode_corner_corner='+'\n    let g:table_mode_header_fillchar='='\n\n\n    +-----------------+--------------------------+------------+\n    | name            | address                  | phone      |\n    +=================+==========================+============+\n    | John Adams      | 1600 Pennsylvania Avenue | 0123456789 |\n    +-----------------+--------------------------+------------+\n    | Sherlock Holmes | 221B Baker Street        | 0987654321 |\n    +-----------------+--------------------------+------------+\n\nMarkdown and ReST filetypes have automatically configured corners.\n\n\u003e If you wish to override their configurations, it should be done in an after\n\u003e plugin, for example :\n\u003e\n\u003e In a `$VIM/after/ftplugin/markdown/custom.vim` you can add the following :\n\u003e\n\u003e ```viml\n\u003e let b:table_mode_corner='+'\n\u003e ```\n\nYou can also define in a table header border how its content should be\naligned, whether center, right or left by using a `:` character defined by\n`g:table_mode_align_char` option.\n\nIf you manipulate the table when table mode is disabled or copy paste a table\nfrom clipboard from outside and it ends up being misaligned, you can realign\nit using `:TableModeRealign` or using the default mapping\n\u003ckbd\u003e\\\u003cLeader\\\u003etr\u003c/kbd\u003e (defined by the option `g:table_mode_relign_map`).\n\n### Formatting existing content into a table\n\nTable Mode wouldn't justify its name if it didn't allow formatting\nexisting content into a table. And it does as promised. Like table creation typing on the fly,\nformatting existing content into a table is equally\nsimple. You can visually select multiple lines and call `:Tableize` on it.\nAlternatively, the mapping \u003ckbd\u003e\\\u003cLeader\\\u003ett\u003c/kbd\u003e can be used (defined by the\noption `g:table_mode_tableize_map`). This converts CSV (Comma-separated\nValues) data into a table.\n\nIf however you wish to use a different delimiter, you can use the command\n`:Tableize/{pattern}` in a similar fashion as you tabulate (e.g.\n`:Tableize/;` uses ';' as the delimiter) or use the mapping \u003ckbd\u003e\\\u003cLeader\\\u003eT\u003c/kbd\u003e\n(defined by the option `g:table_mode_tableize_op_map`) which takes input in the\ncmd-line and uses the `{pattern}` input as the delimiter.\n\n`:Tableize` also accepts a range. Call it by giving\nlines manually like `:line1,line2Tableize`. However this may not be intuitive.\nYou can use the mapping \u003ckbd\u003e\\\u003cLeader\\\u003eT\u003c/kbd\u003e with a `[count]` to apply it to the\nnext `[count]` lines in standard vim style.\n\n### Moving around\n\nNow you can move between cells using table mode motions \u003ckbd\u003e[|\u003c/kbd\u003e,\n\u003ckbd\u003e]|\u003c/kbd\u003e, \u003ckbd\u003e{|\u003c/kbd\u003e \u0026 \u003ckbd\u003e}|\u003c/kbd\u003e to move left | right | up |\ndown cells respectively. The left | right motions wrap around the table\nand move to the next | previous row after the last | first cell in the\ncurrent row if one exists.\n\n### Manipulating Table\n\n- **Cell Text Object** :\n\n  Tableize provides a text object for manipulating table cells. Following\n  the vim philosophy the you have \u003ckbd\u003ei|\u003c/kbd\u003e \u0026 \u003ckbd\u003ea|\u003c/kbd\u003e for the\n  inner and around (including the immediate right table separator) the\n  table cell.\n\n- **Delete Row** :\n\n  You can use the \u003ckbd\u003e\\\u003cLeader\\\u003etdd\u003c/kbd\u003e mapping (defined by the option\n  `g:table_mode_delete_row_map`) to delete the current table row (provided\n  you are within a table row). This can be preceeded with a `[count]` to\n  delete multiple rows as per Vim command grammar.\n\n- **Delete Column** :\n\n  You can use the \u003ckbd\u003e\\\u003cLeader\\\u003etdc\u003c/kbd\u003e mapping (defined by the option\n  `g:table_mode_delete_column_map`) to delete the entire current column\n  (provided you are within a table row), this can also be preceeded with a\n  `[count]` to delete multiple columns.\n\n- **Insert Column** :\n\n  You can use the \u003ckbd\u003e\\\u003cLeader\\\u003etic\u003c/kbd\u003e mapping (defined by the option\n  `g:table_mode_insert_column_after_map`) to insert a column after the\n  cursor (provided you are within a table row). Of course you can use the\n  \u003ckbd\u003e\\\u003cLeader\\\u003etiC\u003c/kbd\u003e mapping defined by\n  `g:table_mode_insert_column_before_map` to insert a column before the\n  cursor. Both can also be preceeded with a [count] to insert multiple\n  columns.\n\n### Highlight cells based on content\n\nYou can highlight cells based on content by setting `let g:table_mode_color_cells` : - cells starting with `yes` will use the `yesCell` highlight group. - cells starting with `no` will use the `noCell` highlight group. - cells starting with `?` will use the `maybeCell` hightlight group.\n\nYou can overwrite any highlight group. For exemple use `hi yesCell ctermfg=2` to remove the background color.\n\n## Advanced Usage: Spreadsheet Capabilities\n\n### Table Formulas\n\nTable Mode now has support for formulas like a spreadsheet. There are 2 ways\nof defining formulas :\n\n- You can add formulas using `:TableAddFormula` or the mapping \u003ckbd\u003e\\\u003cLeader\\\u003etfa\u003c/kbd\u003e\n  (defined by the option `g:table_mode_add_formula_map`) from within a table\n  cell, which will ask for input on the cmd-line with a `f=` prompt. The\n  input formula will be appended to the formula line if one exists or a new\n  one will be created with the input formula taking the current cell as the\n  target cell. The formula line is evaluated immidiately to reflect the\n  results.\n\n- You can directly add / manipulate formula expressions in the formula line.\n  The formula line is a commented line right after the table, or optionally\n  separated from the table by a single empty line. It begins with 'tmf:'\n  (table mode formula). eg) `# tmf: $3=$2*$1`. You can add multiple formulas on\n  the line separated with a ';' eg) `# tmf: $3=$2*$1;$4=$3/3.14`\n\nYou can evaluate the formula line using `:TableEvalFormulaLine` or the\nmapping \u003ckbd\u003e\\\u003cLeader\\\u003etfe\u003c/kbd\u003e (defined by the option `g:table_mode_eval_expr_map`)\nfrom anywhere inside the table or while on the formula line.\n\nNOTE: You can now use the mapping \u003ckbd\u003e\\\u003cLeader\\\u003et?\u003c/kbd\u003e\n\n### Formula Expressions\n\nExpressions are of the format `$target = formula`.\n\n- The `target` can be of 2 forms :\n\n  - `$n`: This matches the table column number `n`. So the `formula` would\n    be evaluated for each cell in that column and the result would be placed\n    in it. You can use negative indice to represent column relative to the\n    last, -1 being the last.\n\n  - `$n,m`: This matches the table cell n,m (row, column). So in this case\n    the formula would be evaluated and the result will be placed in this\n    cell. You can also use negative values to refer to cells relative to\n    the size, -1 being the last (row or column).\n\n- The `formula` can be a simple mathematical expression involving cells\n  which are also defined by the same format as that of the target cell. You\n  can use all native vim functions within the formula. Apart from that table\n  mode also provides 2 special functions `Sum` and `Average`. Both these\n  functions take a range as input. A range can be of two forms:\n\n  - `r1:r2`: This represents cells in the current column from row `r1`\n    through `r2`. If `r2` is negative it represents `r2` rows above the\n    current row (of the target cell).\n\n  - `r1,c1:r2,c2`: This represents cells in the table from cell r1,c1\n    through cell r2,c2 (row, column).\n\n- Examples :\n  - `$2 = $1 * $1`\n  - `$2 = pow($1, 5)` NOTE: Remember to put space between the $1, and 5\n    here otherwise it will be treated like a table cell.\n  - `$2 = $1 / $1,3`\n  - `$1,2 = $1,1 * $1,1`\n  - `$5,1 = Sum(1:-1)`\n  - `$5,1 = float2nr(Sum(1:-1))`\n  - `$5,3 = Sum(1,2:5,2)`\n  - `$5,3 = Sum(1,2:5,2)/$5,1`\n  - `$5,3 = Average(1,2:5,2)/$5,1`\n\n## Demo\n\n\u003ca href=\"http://www.youtube.com/watch?v=9lVQ0VJY3ps\"\u003e\u003cimg\nsrc=\"https://raw.github.com/axil/vim-table-mode/master/youtube.png\"/\u003e\u003c/a\u003e\n\n## Change Log\n\nSee \u003ca\nhref=\"https://github.com/dhruvasagar/vim-table-mode/blob/master/CHANGELOG.md\"\u003e\nCHANGELOG.md \u003c/a\u003e\n\n## Contributing\n\n### Reporting an Issue :\n\n- Use \u003ca href=\"https://github.com/dhruvasagar/vim-table-mode/issues\"\u003eGithub\n  Issue Tracker\u003c/a\u003e\n\n### Contributing to code :\n\n- Fork it.\n- Commit your changes and give your commit message some love.\n- Push to your fork on github.\n- Open a Pull Request.\n\n## Credit\n\nI must thank Tim Pope for inspiration. The initial concept was created by him\nnamed \u003ca href=\"https://gist.github.com/tpope/287147\"\u003ecucumbertables.vim\u003c/a\u003e.\n\nAlso a shout out to godlygeek who developed the incredible \u003ca\nhref=\"http://github.com/godlygeek/tabular\"\u003eTabular\u003c/a\u003e plugin.\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/dhruvasagar/vim-table-mode/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/vim-table-mode/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/vim-table-mode\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/vim-table-mode/contribute)]\n\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vim-table-mode/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/vim-table-mode/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n","funding_links":["https://github.com/sponsors/dhruvasagar","https://opencollective.com/vim-table-mode","https://opencollective.com/vim-table-mode/contribute","https://opencollective.com/vim-table-mode/organization/0/website","https://opencollective.com/vim-table-mode/organization/1/website","https://opencollective.com/vim-table-mode/organization/2/website","https://opencollective.com/vim-table-mode/organization/3/website","https://opencollective.com/vim-table-mode/organization/4/website","https://opencollective.com/vim-table-mode/organization/5/website","https://opencollective.com/vim-table-mode/organization/6/website","https://opencollective.com/vim-table-mode/organization/7/website","https://opencollective.com/vim-table-mode/organization/8/website","https://opencollective.com/vim-table-mode/organization/9/website"],"categories":["Vim script","Vim Script","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvasagar%2Fvim-table-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruvasagar%2Fvim-table-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvasagar%2Fvim-table-mode/lists"}