Home

Awesome

🗓️ mdtt: Markdown Table Editor TUI

<img src="assets/01.gif" width="700">

Editing markdown tables can be a drag. mdtt makes it easier with a slick TUI for terminal use and vim-style keybindings. It supports output to stdout and in-place file editing.

📦 Installation

To install mdtt using Go, run:

go install github.com/szktkfm/mdtt/cmd/mdtt@latest

Or, download it:

GitHub Releases

🎬 Usage

To start editing your markdown table, simply run:

mdtt filename.md

Upon launching, mdtt will display the tables from your markdown file in a TUI.

While editing, you can utilize the following vim-like keybindings to navigate and modify your tables efficiently:

<img src="assets/02.gif" width=500>

For direct editing and saving changes to the same file, use:

mdtt -i filename.md
<img src="assets/03.gif" width=500>

You can use piping with mdtt as shown below:

pbpaste | mdtt | pbcopy
<img src="assets/04.gif" width=500>

To create a new table without an existing file, run mdtt without any arguments:

mdtt
<img src="assets/05.gif" width=300>

When multiple tables are present, you will be prompted to select the table you wish to edit.

<img src="assets/06.gif" width=500>

Press I to open the cell in the text editor set as your $EDITOR, allowing you to edit the cell directly within your chosen editor.

<img src="assets/07.gif" width=500>

⌨️ Key Bindings

KeyAction
/kMove up
/jMove down
/hMove left
/lMove right
b/pgupPage up
f/pgdnPage down
ctrl+uHalf page up
ctrl+dHalf page down
g/homeGo to start
G/endGo to end
iInsert mode
IOpen $EDITOR
esc/ctrl+cNormal mode
o/voAdd row/column
dd/vdDelete row/column
yy/vyCopy row/column
pPaste
qQuit
?Toggle help

📝 Features

🙏 Acknowledgments

This project, mdtt, was inspired by mdvtbl, a tool that reads markdown from stdin, allows for table editing in a web view, and outputs to stdout.

License

MIT