yibie / list-transform

Transform a bullet list to a sentence and vice versa in Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

list-transform for Emacs

Transform a bullet list to a sentence and vice versa. It’s a Emacs port of the Vim plugin listtrans.vim.

E.g.

- Apple
- Banana
- Orange

becomes

Apple, Banana, and Orange

./demo.gif

You can call it M-x list-transform or bind it to a key.

I use it with evil mode and bound it to =,l=:

(evil-set-leader 'motion (kbd ","))
(evil-define-key 'motion 'global (kbd "<leader>l") 'list-transform)

Customization

Use (setq varname value) to customize list-transform’s behavior:

list-transform-and-word
The word before the last list item in a sentence. Set to nil to use a comma only. Default is =”and”=.
list-transform-oxford-comma
Put a comma before list-transform-and-word in a sentence. Default is t.

Todo

The original listtrans.vim works also with semicolons and other conjuction words like “and not”, “plus”, “or else”, …

This is not yet implemented.

About

Transform a bullet list to a sentence and vice versa in Emacs.


Languages

Language:Emacs Lisp 100.0%