List-edit provides list-aware cut, copy, and paste operations that automatically handle separators and whitespace, while taking into account strings and comments. For example, to cut the first element from
[Three, One, Two] and paste it at the end:
list-cut the list element that contains the cursor is removed, together with its trailing separator and whitespace. After moving the cursor past the last element,
list-paste inserts the cut element and puts a separator and whitespace in front of it. List-edit also works in a vertical layout and on multiple elements:
And even between different lists (with yet another layout):
List-edit uses the grammar of the edited file to ignore strings and comments, but list detection takes place purely on a lexical level. Currently,
() are brackets, and
; are separators.
For more information, including a small emulator, in which you can try out the package, visit list-edit.oblomov.com.
These are Mac key bindings, for Windows and Linux use
ctrl-alt instead of
||Select element at cursor, or range of elements in selection|
||Cut elements (and separator+whitespace) at cursor/selection|
||Copy elements at cursor/selection to the clipboard|
||Paste elements (and separator+whitespace) at cursor/selection|