When I use :w to save my JSON file, vim automatically adds some commas at syntactically significant (?) places.  It does not happen when I use :x or ZZ.  This started today.  I did not change anything about vim (expect just tab space).

Here’s an animated demonstration:

Do you have any suggestions? I can't figure out why this is happening.

  • 3
    Linter or plugin or both.
    – Alex Kroll
    Jul 7, 2019 at 20:32
  • 3
    Most likely it is some plugin. You may be able to identify the guilty by executing autocmd BufWritePre. If not debug your vimrc.
    – Ralf
    Jul 8, 2019 at 4:44
  • 3
    You can try :Xverbose w where X is 9, 12 or 15 (increasing numbers provide further levels of detail...sometimes too much detail thus start lower and then go higher if necessary) If that doesn't lead you to the answer then follow the link Ralf provided.
    – B Layer
    Jul 8, 2019 at 5:17
  • 1
    I've learned a lot while reading about :autocmd and :verbose. Debugging your vimrc looks like a great post. Thank you very much.
    – 1t1e1
    Jul 8, 2019 at 10:43


Browse other questions tagged or ask your own question.