Skip to content

rpeshkov/vscode-text-tables

Repository files navigation

Text Tables

version license Build Status

Text tables

VSCode extension that brings the power of Emacs table editing.

Sample

Features

  • Tables reformat
  • Easy table cells navigation
  • Support for org and markdown tables

Activation

Extension is automatically activated when you open markdown or org file. If you want to use this extension in any other file, just trigger Text Tables: Enable command in command pallete.

Commands

Extension provides several commands that are available in the Command Palette:

  • Text Tables: Enable - enable extension.
  • Text Tables: Create table - create new table in cursor position.
  • Text Tables: Format under cursor - reformat the table under cursor.
  • Text Tables: Enter table mode - enter table mode.
  • Text Tables: Exit table mode - exit table mode.
  • Text Tables: Go to next cell - switch to next cell in current table.
  • Text Tables: Go to previous cell - switch to previous cell in current table.
  • Text Tables: Clear cell - clear cell under cursor.

You can access all of the above commands from the command pallete (Ctrl+Shift+p or Cmd+Shift+p)

Table mode

Table mode is the mode where some of the default keybindings have another action assigned.

To enter table mode you may execute command Text Tables: Enter table mode from command palette or press Ctrl+q Ctrl+q shortcut to toggle mode. To control whether you're in table mode or not, see the icon in the status bar of Visual Studio Code:

Table mode status

When in table mode, Tab and Shift+Tab keybindings will navigate next/previous cell accordingly.

Navigation

Keybindings

  • Ctrl+q f - format table under cursor.
  • Ctrl+q space - clear cell under cursor.
  • Ctrl+q Ctrl+q - toggle table mode.

In table mode

  • Tab - navigate to the next cell in table.
  • Shift+Tab - navigate to the previous cell in table.

Custom keybindings

Extension introduces additional tableMode when-clause that you may use to define your own keybindings when in table mode.

Sample keybinding:

{
    "key": "tab",
    "command": "text-tables.gotoNextCell",
    "when": "tableMode"
}

Settings

This extension introduces some settings that you may setup in your user settings or workspace settings.

Available settings:

  • text-tables.mode - sets the type of tables. Valid values are: org and markdown.
  • text-tables.showStatus - controls whether to show or not status item for table mode.

Contribution

All contributions are welcome.

If you found a bug or want to propose new feature for the extension, feel free to create an issue.