2

Vim has the option to automatically continue comments when a new line is entered as described here. This currently works perfectly for // and # in .cpp and .python files respectively.

I tried to add the following line to the .vimrc for lisp

autocmd filetype lisp,clojure setlocal comments+=:;;

I also tried to set it manually in a file via :set comments=:;;. All to no avail.

I have checked that vim is compiled with the comments flag set.

1

Check your filetype:

:set filetype?

It should show

filetype=lisp

If it is empty, then auto-comments would not work.

Same applies to

:set formatoptions?

The should look like

formatoptions=croql

and not be empty.

  • The important part was the l in formatoptions. Thanks. – rex123 Sep 21 '18 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.