The default settings for TextMate 2 have soft wrapping turned on for text scopes. When I'm editing a LaTeX document (text.tex.latex), this is fine, except for tables. Inside of tabular environments I've usually got the columns lined up so it's easier to read the source file, but when soft wrapping is turned on this just becomes a huge mess. I thought it would be possible to turn soft wrap off inside tables through the .tm_properties file, and I tried adding this rule
[ meta.function.environment.tabular.latex ] softWrap = false
but this doesn't seem to do anything. Do scope selectors work the same way in .tm_properties as elsewhere? Does anyone have a suggestion for this, short of altering the LaTeX bundle? Thanks for any help!
-Daniel Grady
The scope of a tabular environment is
text.tex.latex meta.function.environment.general.latex meta.function.environment.tabular.latex meta.data.environment.tabular.latex meta.row.environment.tabular.latex meta.cell.environment.tabular.latex attr.rev-path.tex.example.Documents.dgrady.Users attr.os-version.10.6.8
Here is a short example that shows what I'm trying to accomplish:
\documentclass{article}
\begin{document}
This line should soft-wrap: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor.
\begin{table}
\begin{tabular}{c} Lines inside the tabular environment should not soft wrap: Lorem ipsum dolor sit amet, consectetur. \end{tabular}
\caption{The caption should soft wrap: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.}
\end{table}
\end{document}
On 24/01/2012, at 01.51, Daniel Grady wrote:
[ meta.function.environment.tabular.latex ] softWrap = false
but this doesn't seem to do anything. Do scope selectors work the same way in .tm_properties as elsewhere? Does anyone have a suggestion for this, short of altering the LaTeX bundle? Thanks for any help!
At least for now, .tm_properties can only select on the root file type.
You can make a new setting via the bundle editor where you can set a full scope selector and set softWrap = :false.
Allan Odgaard <mailinglist@...> writes:
At least for now, .tm_properties can only select on the root file type.
Good to know!
You can make a new setting via the bundle editor where you can set a full scope selector and set softWrap = :false.
Done, and it's working great. Thanks for the help!
-Daniel Grady