I am using LazyVim to configure neovim, I have turned off format on save and now when I save white spaces are added at specific places which I don't want. How can I stop this white spaces to be added on save.

enter image description here

  • Welcome to Vi and Vim SE. Please share text as text, not as an image. Having said that, your question wouldn't be worse off without the image. You show a diff that's supposedly caused by whitespace changes but we don't see it because whitespace isn't shown.
    – Friedrich
    Jan 9 at 10:56
  • I'm afraid your screenshot could be more helpful if the non visible text would be displayed to identify what they are. Could you provide the same screenshot after the following commands have been executed: :set listchars+=lead:.,trail:~,space:.,tab:->, :set list? Jan 9 at 11:30
  • It would also be helpful to know the filetype of the buffer (:set ft?) and what kind of plugin have been installed in the lazyvim configuration. Jan 9 at 11:31
  • line 167 looks like a tab/expandtab setting. Please provide clarification, whether you want tabs expanded or not. Line 172/173 looks like you manually added empty lines. Simply do not add them, if you do not want them Jan 9 at 11:53
  • spaces, tabs and empty lines already exist but when I click on C+s to save these lines are highlighted in git diff view, but this behaviour does not exists in vscode Jan 10 at 7:48


Your Answer

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

Browse other questions tagged or ask your own question.