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 Answer 1

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.

1
  • The important part was the l in formatoptions. Thanks.
    – rex123
    Sep 21, 2018 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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