Coqtail
Coqtail copied to clipboard
Different bullets have different formatting behavior
Versions
Coq 8.15.0
Coqtail 1.6.2
Vim 8.2
Equations 1.3
Python 3.7.4
Description
If you try to open a new line after a line that starts with a bullet,
the new line will be a duplicate of the previous line if the bullet is *
or
blank if the bullet is -
, +
or one of the others.
You can easily observe this by
- opening
coq/theories/Lists/List.v
, - making sure to
setlocal formatoptions+=o
, - navigating to the definition of
in_in_remove
and - jumping to each of the bullets in turn and
hitting
o
followed by<Esc>
.
That's because a line beginning with *
could either be a bullet or a comment continuation, and I don't know of a way to teach Vim to recognize the difference with respect to formatoptions+=o
. That's why I remove that option in the ftplugin.
I guess another option might be to define 'comments'
without the middle part (comments=srn:(*,exn:*)
), but I'm not entirely sure what other consequences that might have.
I seem to keep bumping my head onto issues that have already been considered; sorry about that. In this case (and even in general), it would be helpful to know which options are set by plugins and which ones I could or should customize. For example, I prefer disabling middle parts of comments and automatic indentation of lines as I am typing them, because they are distracting, but some plugins try to force them on me anyway.
No need to apologize. I made a lot of these decisions a while ago when I was pretty much the only user so I'm glad to get more opinions on them. Part of the challenge with a language plugin like Coqtail is finding a good balance of setting certain options to sensible defaults without stepping on users' own custom setups too much.
In this case (and even in general), it would be helpful to know which options are set by plugins and which ones I could or should customize.
I agree, and a good step would be to document all of the options that Coqtail sets by default along with simple instructions for overriding/disabling them.
If you feel up to it feel free to open a PR. The options for the main coq
filetype are set in ftplugin/coq.vim
, indent/coq.vim
, and syntax/coq.vim
, and the coq-infos
and coq-goals
filetypes are configured in autoload/coqtail/panels.vim
.
Related: #282 (which I haven't forgotten about, I just haven't had a chance to get to it yet)