#+TITLE: Valign.el

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~:
#+begin_src emacs-lisp
(add-hook 'org-mode-hook #'valign-mode)
#+end_src

[[./default.png]]

[[./table.el.png]]

*Know 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 [[https://github.com/casouri/ftable][ftable.el]] to auto-layout the table for you.

* Install with quelpa

Firmin Martin kindly provided this snippet:
#+begin_src emacs-lisp
(use-package valign
  :quelpa (valign :fetcher github :repo "casouri/valign")
  :ensure t
  :config
  (add-hook 'org-mode-hook #'valign-mode))
#+end_src

* Customization
Set ~valign-fancy-bar~ to ~non-nil~:

[[./fancy-bar.png]]

This only affects Org Mode and Markdown 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.
