Hi,
I see you indeed were patient. It took quite some time because I discovered this proposal:
https://code.google.com/p/vimwiki/wiki/NewLists and
implemented most of the design goals mentioned there, especially the following:
- a list item can have line breaks
- a list item can contain every other syntax element, including other lists, but excluding header lines
- a list item can contain empty lines. This leads to a problem I mention below
- for default and markdown syntax the level of an item is determined by its indent, for media syntax by the number of markers (# ## ### and so on)
Where my implementation differs from the proposal:
- header lines end every list
- the assignment in nested lists is different, for example:
- Item 1
- Subitem 1 of Item 1
- Subitem 2 of Item 1 (in the proposal, this would be Item 2)
- Item 2
To be more precise, what has changed now is the following (I hope I don't forget anything):
- there are 3 types of markers list items can have:
1. bullets, like -
2. bullets that can occour repeatedly, like *, **, ***
3. numbers, like 1. 2. 3. or a) b) c) or I] II] III]
- but I think we need a fourth type, that behave like bullets inside Vim but are converted to numbered items in HTML
- Btw, description lists should work as they used to, I did not touch something about them
- the following keys do cool things now:
- i_<CR> in a list item inserts a new bullet or number in the next line, numbers are incremented, of course
- i_<CR> in an empty list item deletes the item marker. This is useful to end a list, you simply press <CR> two times.
- i_<S-CR> in the current settings does *not* insert a new list item
- o and O insert new list markers, as you would expect it
- glh gll i_<C-T> i_<C-D> indent or de-indent(?) the current line, in most of the cases the markers are readjusted
- gLh gLl indent a list item plus all child items
- i_<C-A> i_<C-S> change the marker of the current list item, e.g. from - to a) to 1. and so on
- glr renumbers a messed-up numbered list
- gLr dito, but for the whole buffer
- <C-Space> makes a [X] checkbox or toggles it (and in many cases the checkboxes of parent and child items are updated)
- gl<Space> removes a checkbox from an item
- i_<C-B> (maybe we find a better key) removes a marker from a list item (useful for typing multiline list items) or creates one
- gl- gl* gl1. gla) (etc., these maps are created automatically) make a list item out of a normal line or change the marker for the current item
- gL- gL* gL1. gLa) etc. change the marker of the current list to - * 1. a) etc.
- gq works like one would expect it
- where it makes sense, these commands also work with a range or in visual mode
- what is also cool is that if you set g:vimwiki_hl_cb_checked=2 in your vimrc, a [X] checked checkbox is now highlighted *plus* every child item,
if it has a checkbox or not. I find this very useful.
- what is missing:
- doc
- at the moment, the types of markers for bulleted and numbered lists can easily be changed in ftplugin/vimwiki.vim, but not in the .vimrc
see this file (line 47ff.) for the current settings for the various syntaxes
- the HTML conversion
- The Problem with empty lines: The thing is, what I had in mind when I made all these changes is to use vimwiki not only for small shopping lists or
so but as a full outline editor, where I can put all my notes and thoughts in a complex hierarchical structure. That means that sublists can be very
long. If every empty line would break a list in two this would be very limiting in my eyes.
Allowing or permitting empty lines would, as far I can see, concern the following cases:
- numbering of numbered lists
- in the HTML export, every empty line currently starts a new paragraph
The problem here is that a blockquote can not be distinguished from a indented line that belongs to a list item above it. So we would need a new
blockquote syntax. The proposal mentions a solution for this.
What do you think, allow or permit empty lines in lists?
So, I attached my sources here, please play with it and let me know what you think!
By the way: I tried lists in MS Word and in Emacs org-mode, but my implementation is more fun :D
Am Samstag, 29. September 2012 03:14:21 UTC+2 schrieb Stu: