I am trying to create a key binding that will help Git work better with LaTeX files. The goal is to have my TeX files have one sentence of text per line. (The simplest version would be to get used to manually inserting a line break after each period, but I do not want this to become a habit when I’m not using TeX.)
The current plan is to have the space character bound to a simple command so that
Hello world. |
will result in
[code]Hello world. %
|[/code]
(I’m using ‘|
’ to represent the position of the cursor.)
So far, this is what I have, which seems to work just fine:
{ "keys": " "],
"context":
{"key": "selector", "operator": "equal", "operand": "text.tex.latex"},
{"key": "preceding_text", "operator": "regex_match", "operand": "(^.+\\.$)|(^.+\\?$)|(^.+\\.+\\)$)"}
],
"command": "insert", "args": {"characters": " %\n"}
}
The problem is that I do not want this functionality when I’m using TikZ. So I’m looking for a way of restricting this functionality to when I’m not inside a ‘tikzpicture’ environment. Thoughts?