Coder Social home page Coder Social logo

valign's Introduction

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.

valign's People

Contributors

casouri avatar evanmeek avatar ksqsf avatar monnier avatar tumashu avatar willbchang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.