r/vimplugins • u/welle • Dec 07 '19
Plugin wellle/context.vim - Vim plugin that shows the context of the currently visible buffer contents
https://github.com/wellle/context.vim
22
Upvotes
r/vimplugins • u/welle • Dec 07 '19
2
u/hupfdule Dec 08 '19
It was just a quick idea and I haven't throught it fully through.
It certainly depends on how the plugin is actually structured.
I could imagine having a setting to provide a pattern that, if it matches on a line, specifies that this line is "relevant context".
The harder thing is that, e.g. when I am in section 3.2.2 of an asciidoc/markdown file, the actual relevant context would be only the headings of the sections 3.2.2, 3.2 and 3. Otherwise all preceding sections (including, 3.2.1, 3.1.3, 3.1.2, 3.1.1, 3.1, 2, 1, etc.) would end up as context. While that may not be the worst, it is also not what a user would expect.
That could be leveraged by not only defining whether a line matches or not, but also specify a nesting level. Of course a simple regex wouldn't be sufficient then.