0

I'm using VS Code to write LaTeX and doing version control using git. Therefore, I would like to have one sentence per line.

\section{Hello}
This is a sentence.
This is another sentence.

What I would like is for VS Code to automatically add a new line after I hit space when followed by a period. This is possible for instance in Sublime:

https://forum.sublimetext.com/t/insert-new-line-after-specific-character/15190

How can I define a similar key binding in VS Code?

starball
  • 20,030
  • 7
  • 43
  • 238
eyldlv
  • 1
  • 1

1 Answers1

0

I don't think you can (though I'd be happy to be wrong). Unlike Sublime, as far as I know, at the time of this writing, VS Code does not have a when clause context for matching preceding text in the editor. You might be able to write an extension or find one that helps achieve this, but I'm not sure about the details of how that would work. Another different approach could be to look for a customizable formatter where you can add a rule to do this upon formatting.

If you want to get a when clause for matching preceding text in the editor, you could raise a feature-request. If you do, please ping me with a link to it, either here as a comment or a suggested edit, or in your issue ticket with @starball5.

starball
  • 20,030
  • 7
  • 43
  • 238