I've looked through the vimwiki
documentation and a few questions here on SO, but don't see how I can manage this. In vim-notes
, hitting TAB
within a list indents the entire list item. In vimwiki
, hitting TAB
within a list indents within the list item, leaving the list marker unmoved.
For example, I have written one list item and hit ENTER
to start a second. Both vimwiki
and vim-notes
treat this similarly: they both match the indentation and list marker of the preceding line. [Here >---
is a TAB
character, *
is the list marker, and |
is the curser position.]
1 >--- * My list item
2 >--- * |
If I'm using vim-notes
, hitting TAB
will achieve this:
1 >--- * My list item
2 >--- >--- * |
In vimwiki
, hitting TAB
will achieve this:
1 >--- * My list item
2 >--- * >---|
Obviously I can exit insert mode, navigate to the start of the line, hit TAB
, then hit A
to continue typing at the end of the line but that's not a good flow.
There is a setting, g:notes_tab_indents
, that controls this behavior in vim-notes
, but I haven't found a corresponding control for vimwiki
. The closest reference I can find to the behavior vimwiki
anticipates supporting is in g:vimwiki_folding
where it discusses how vimwiki
expects lists to be "nicely indented with shiftwidth
":
*g:vimwiki_folding*
Enable/disable Vimwiki's folding (outline) functionality. Folding in
Vimwiki can uses either the 'expr' or the 'syntax' |foldmethod| of Vim.
Value Description~
'' Disable folding
'expr' Folding based on expression (folds sections and code blocks)
'syntax' Folding based on syntax (folds sections; slower than 'expr')
'list' Folding based on expression (folds list subitems; much slower)
'custom' Leave the folding settings as they are (e.g. set by another
plugin)
Default: ''
Limitations:
- Opening very large files may be slow when folding is enabled.
- 'list' folding is particularly slow with larger files.
- 'list' is intended to work with lists nicely indented with 'shiftwidth'.
- 'syntax' is only available for the default syntax so far.
The shiftwidth
documentation describes functionality I'd never known about before: <<
and >>
. The former reduces the current line/selection's indent by one tab stop; the latter expands the indentation. This is obviously not available in insert mode, so not optimal, but it'll definitely do in a pinch (especially when I remap it).
I read through the vim-notes
code and short of replicating the functions in my own (first) project, I'm not sure if there is some vim
functionality, e.g., some keymapping, that can achieve at least the TAB
indentation behavior (much of the relevant vim-notes
functions use regex patterns to match bullet styles).
Thanks in advance.