• Stars
    star
    386
  • Rank 111,213 (Top 3 %)
  • Language
    Emacs Lisp
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pixel-perfect visual alignment for Org and Markdown tables.

Valign.el

中文 README

This package provides visual alignment for Org Mode, Markdown and table.el tables on GUI Emacs. It can properly align tables containing variable-pitch font, CJK characters and images. Meanwhile, the text-based alignment generated by Org mode (or Markdown mode) is left untouched.

To use this package, load it and add valign-mode to org-mode-hook or markdown-mode-hook:

(add-hook 'org-mode-hook #'valign-mode)

./default.png

./table.el.png

Known problems:

  • Hidden links in markdown still occupy the full length of the link, because it uses character composition which we don’t support now.
  • Rendering large tables (≥100 lines) is laggy.

Note:

For table.el tables to work with valign, each cell has to have at least one space on the right and no space on the left. You can use ftable.el to auto-layout the table for you.

Install

You can obtain valign.el from GNU ELPA by typing:

M-x package-install RET valign RET

Customization

Set valign-fancy-bar to non-nil:

./fancy-bar.png

This only affects Org Mode and Markdown tables.

By default, valign doesn’t re-align the table after normal edit commands like self-insert-command and backward-kill-word. If you want valign to not re-align the table after a certain command, add that command to valign-not-align-after-list.

Because valign isn’t particularly efficient, it doesn’t align tables larger than 4000 characters in size. If you want to change that behavior, customize valign-max-table-size. Valign puts valign-table-fallback face on those large tables.

Other (less interesting) customization:

  • valign-signal-parse-error: Set to non-nil to be informed of parse errors.
  • valign-lighter: Lighter in mode-line.
  • valign-box-charset-alist: Used for defining table.el tables, e.g., Unicode/ASCII tables.

If function advice makes you itch

valign-mode adds advice and doesn’t remove them even if you close valign-mode because function advice is global and valign-mode is local. If you want to remove the advice, use valign-remove-advice. If you run this while some buffer still has valign-mode on, they break.

More Repositories

1

vundo

Visualize the undo tree.
Emacs Lisp
284
star
2

lunarymacs

Moon-based Emacs configuration.
Emacs Lisp
220
star
3

eldoc-box

childframe doc for eglot and anything that uses eldoc
Emacs Lisp
210
star
4

tree-sitter-module

Building script for tree-sitter language definitions
Shell
106
star
5

OrgMark

Insert and edit drawing in Org mode with iPad.
Swift
94
star
6

xeft

Fast, interactive Emacs note searching
Emacs Lisp
62
star
7

undo-hl

Highlight undo operations so you never get lost
Emacs Lisp
57
star
8

iscroll

Smooth scrolling over images in Emacs
Emacs Lisp
52
star
9

isolate

Surrounding magics, extensible
Emacs Lisp
49
star
10

ftable

Fill (auto-layout) tables
Emacs Lisp
44
star
11

ghelp

Emacs generic Help
Emacs Lisp
36
star
12

collab-mode

Cross-editor collaboration (WIP)
Rust
36
star
13

emacs-mission-control

Mac mission-control-like buffer switch
Emacs Lisp
34
star
14

ivy-filthy-rich

Richer information for ivy candidates, fully customizable
Emacs Lisp
19
star
15

casouri.github.io

My blog
HTML
16
star
16

trivial-copy

Copy, paste and move files like you do in Finder in Dired.
Emacs Lisp
14
star
17

awesome-himawari8

A collection of a bunch of implementations of himawari8 live earth desktop in many languages
12
star
18

nerdtab

Keyboard oriented tabs for Emacs
Emacs Lisp
9
star
19

expreg

Your friendly neighborhood expand-region clone
Emacs Lisp
6
star
20

quick-mathlive

Quick mathlive from commandline
JavaScript
6
star
21

weibo2mast

微博转发毛象(mastodon)bot
Python
5
star
22

highres-tab-line

High-res tab-line icons
4
star
23

config

my configurations
Python
4
star
24

zeft

Yet another Deft
Emacs Lisp
4
star
25

lunarySpoon

Sequential key binding for hammerspoon
Lua
4
star
26

find-char

A taste of the `f` operator of vim in Emacs.
Emacs Lisp
4
star
27

xapian-lite

Xapian dynamic module for Emacs
C
4
star
28

emacs-module-prelude

Convenient functions for Emacs dynamic modules.
C
3
star
29

emacs-file-icon

icons for emacs openable files
Python
3
star
30

nyan-lite

Nyan Mode Lite
Emacs Lisp
3
star
31

lunarymacs-stars

Default (my own) stars of lunarymacs
Emacs Lisp
3
star
32

pbcopyf

copy/paste/move files from command line for macOS
Swift
2
star
33

cq-80

Splatoon 2 Octo Expansion CQ-80 terminal replica
C++
2
star
34

lunaryline

A minimum alternative of spaceline.
Emacs Lisp
2
star
35

camelsnake-mode

Type camelCase and get snake_case
Emacs Lisp
2
star
36

fshell

M-x shell improved
Emacs Lisp
1
star
37

monovault

CSE 223B class project
TeX
1
star
38

mac-greek-substitution

macOS substitution for greek
1
star
39

launchdman

launchd parser and manager for Python
Python
1
star
40

hmx

Haskell
1
star
41

grade-analyzer

Fetch grade from Canvas and analyze it.
Python
1
star