Closed vsiles closed 3 years ago
I tried to comment them all and the issue is still here. But if I start with vim --clean
it is no longer here. I see I have a .vim/pack/coq
directory with coq.vim in it. If I remove this, the issue disappears too.
I also try to only leave CoqTail
enabled, and the issue is still here, so probably not a bad interaction with another plugin.
I don't remember installing coq.vim by hand (maybe, but really doesn't ring a bell). Is it installed as part of Coqtail ? Should I report the issue to them ?
Can you try removing coq.vim and and reinstall Coqtail? If that doesn't fix, can you check the result of verb set comments formatoptions indentexpr indentkeys
?
I removed the pack/coq directory, removed CoqTail and reinstall it. The issue has been removed and the pack/coq directory has not been restored.
However now indenting seems to not work at all. Should I run something to setup indenting ?
In case it is useful, here is the output of the command you asked:
comments=srn:(*,mb:*,exn:*)
Last set from ~/.vim/bundle/Coqtail/ftplugin/coq.vim line 16
formatoptions=tcql
Last set from ~/.vimrc line 186
indentexpr=GetCoqIndent()
Last set from ~/.vim/bundle/Coqtail/indent/coq.vim line 17
indentkeys=o,O,0=end,0=End,0=in,0=|,0=Qed,0=Defined,0=Abort,0=Admitted,0},0),0-,0+,0<*>,0--,0++,0<*><*>,0---,0+++,0<*><*><*>
Last set from ~/.vim/bundle/Coqtail/indent/coq.vim line 18
Line 186 is autocmd FileType coq setlocal formatoptions-=o
. I get the same behavior with or without it
Do you have let g:coqtail_noindent_comment = 1
in your vimrc? This disables indentation in comments.
Can you try inserting *
? The default option in Coqtail aligns the comment line when *
is typed.
For example, suppose the cursor is at the first column of the second line:
(*
|
If you type *
, it will be automatically aligned.
(*
*|
Do you have
let g:coqtail_noindent_comment = 1
in your vimrc?
No:
$ grep coq .vimrc
autocmd FileType coq setlocal commentstring=(*\ %s\ *)
" autocmd FileType coq setlocal formatoptions-=o
" let g:syntastic_coq_checkers = []
Ok. I tried what you explained and it seems to work that way. Not the way I was used to but I don't care, things work now :) Thanks for helping me with this issue !
Hello all, I replaced comments
in the ftplugin/coc.vim
with setlocal comments=sO:*\ -,mO:*\ \ ,exO:*),s1:(*,mb:*,ex:*)
This will enable comments like, inserting the proper *
in the beginning of the line automatically.
(* foo
* bar
* zar ... *)
I copied this from the C mode and adapted, not sure if this is the preferred commenting style though. I have set fo+=r
in my .vimrc.
I didn't change any Coqtail settings in the .vimrc
file.
Not sure how to do this on .vimrc
without intruding on the Coqtail code though. Here is the full if block
if has('comments')
setlocal commentstring=(*%s*)
"setlocal comments=sr:(*\ ,mb:\ ,ex:*)
"setlocal comments^=sr:(**,mb:\ \ ,ex:*)
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*),s1:(*,mb:*,ex:*)
" NOTE: The 'r' and 'o' flags mistake the '*' bullet as a middle comment and
" will automatically add an extra one after <Enter>, 'o' or 'O'.
" setlocal formatoptions-=tro formatoptions+=cql
" let b:undo_ftplugin = add(b:undo_ftplugin, 'setl cms< com< fo<')
endif
Not sure how to do this on .vimrc without intruding on the Coqtail code though.
One way to do that in .vimrc:
" NOTE: This should be executed before setting up the custom FileType autocmds.
filetype plugin indent on
augroup MyFileTypeSetup | autocmd!
autocmd FileType coq call s:ft_coq()
augroup END
function! s:ft_coq() abort
" Your settings here..
endfunction
Alternatively, you can create after/plugin/coq.vim
file in your runtimepath
(e.g. ~/.vim
) and put your custom settings there.
Thanks @tomtomjhj!
That might be a bad interaction with another plugin, but I don't know how to debug this: I often write multi-line comments, and when I hit "return" at the end of a line, the current line is duplicated. Also, the
*
indentation looks incorrect. If I'm in edit mode at the end of the line and I hit return, thisbecomes
Note that the
*
is not aligned. Now If I do the same withI end up with
Any idea how to debug this ? In the meantime I'll try to check which plugins might interfere. Here is my list:
loaded with Vundle