On 24/01/2012, at 20.54, Dirk Günther wrote:
> I use the LaTeX grammar and I have defined my own shortverb
> command [...] What should I do that |c| in \tabular{...} is not defined as
> verbatim?
As Allan suggested, I think that you need to have a rule in the LaTeX
grammar that will match the column specification part of the tabular
environment. Instead of writing a completely new rule, I tried changing the
relevant existing rule, copied below. The only difference is in the begin
match. I also tried adding your rule for scoping anything between pipes as
verbatim, and this change to the tabular rules seems to do what you want -
anything in the column spec is not scoped as verbatim. Hope that helps!
-Daniel Grady
{ begin = '(?x)
(?:\s*) # Optional whitespace
((\\)begin) # Marker - Function
(\{) # Open Bracket
(array|tabular[xy*]?)
(\}) # Close Bracket
(\s*\{.*\})? # Column specification
(\s*\n)? # Match to end of line absent of content
';
captures = {
1 = { name = 'support.function.be.latex'; };
2 = { name = 'punctuation.definition.function.latex'; };
3 = { name = 'punctuation.definition.arguments.begin.latex'; };
4 = { name = 'variable.parameter.function.latex'; };
5 = { name = 'punctuation.definition.arguments.end.latex'; };
6 = { name = 'variable.columnspec.tabular.latex'; };
};
contentName = 'meta.data.environment.tabular.latex';
end = '(?x)
(?:\s*) # Optional whitespace
((\\)end) # Marker - Function
(\{) # Open Bracket
(\4) # Previous capture from begin
(\}) # Close Bracket
(?:\s*\n)? # Match to end of line absent of content
';
name = 'meta.function.environment.tabular.latex';
patterns = (
{ match = '\\';
name = 'punctuation.definition.table.row.latex';
},
{ begin = '(?:^|(?<=\\\\))(?!\\\\|\s*\\end\{(?:tabular|array))';
end = '(?=\\\\|\s*\\end\{(?:tabular|array))';
name = 'meta.row.environment.tabular.latex';
patterns = (
{ match = '&';
name = 'punctuation.definition.table.cell.latex';
},
{ begin = '(?:^|(?<=&))((?!&|\\\\|$))';
end = '(?=&|\\\\|\s*\\end\{(?:tabular|array))';
name = 'meta.cell.environment.tabular.latex';
patterns = ( { include = '$base'; } );
},
{ include = '$base'; },
);
},
{ include = '$base'; },
);
}
Setup:
Some text here {Some text here {some more text here}} Some text here
1. Place cursor after the first } but before the second }
2. Press Ctrl-Up.
My understanding is that the cursor should jump to just after the first {,
instead it lands just before the second {.
Cheers,
David.
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}
Hello,
I use the LaTeX grammar and I have defined my own shortverb command: | so
that I can write |foo| and have everything enclosed in | and | treated the
same as \verb|foo|. So I'd like to mark the contents between | and | as
verbatim, but not in the tabular definition such as
\begin{tabular}{|c|c|c|c}
My attempt
{ begin = '\|';
beginCaptures = { 0 = { name = 'punctuation.definition.verb.latex'; }; };
end = '\|';
endCaptures = { 0 = { name = 'punctuation.definition.verb.latex'; }; };
name = 'markup.raw.verb.latex';
},
works for requirement #1, but not for #2 (the tabular case). What should I
do that |c| in \tabular{...} is not defined as verbatim?
Thanks
Dirk
I want to access a set of 5 files which are not all in one folder. I can get
all 5 into the file browser and work with them. Good so far. Now I want to
save the set so that next month, when I need another change, I can open the
same set of files without visiting each location individually. What's a good
way to open the set of files with one action? I don't have control over
where the original files are stored. They are part of Apache2.
I thought of making a folder with a link to each file, which is ok for 5
files, but not for a larger group.
I think that .tm_properties might be an approach, perhaps by setting up a
folder with a list of includes, but that seems kind of clumsy. I suspect
this isn't hard, but I'm still finding my way around TM2. Any hints,
guidelines, whatever?
--Lewy
--
View this message in context: http://old.nabble.com/TM2-saving-pointers-to-set-of-files-tp33185861p331858…
Sent from the textmate users mailing list archive at Nabble.com.
TextMate 2 seems very promising feature wise, but one of my biggest complaints with version 1 was the slow performance of extremely large projects (20k+ files), particularly when using the "Go to file" command. I was very disappointed then to see that the v2 alpha is even slower in this regard, unusably so. When I try to type a file name, one letter appears at a time with up to ten seconds in between, and this is on a quad core i7 with an SSD. Even using the `find` command from the terminal is faster, and it walks the entire directory tree every time.
I understand that this is an alpha, and that performance was one of the things that was left for later tuning. But I'm afraid that more than tuning is needed in this case, although I could be wrong. I would simply ask that the performance of large projects be made more of a priority than it currently is.
Thanks,
Connor McKay
Hi,
Does anyone know what might prevent the results of a an executed command to show up in the R Console? Every time I type a command the line ends up cleared and no output is displayed. It seems that the command is getting executed as I can can see the result if I open up r_out. It even shows up in the history.
Here is a simple example of what I get on newly installed Rdaemon after launching from TM_Rdaemon.app and executing:
> ls()
After hitting return the console gets cleared to:
>
In r_out I get:
WARNING: unknown option '--TMRdaemon'
ARGUMENT '2' __ignored__
> source("/Users/linaskk/Library/Application Support/Rdaemon/daemon/start.r")
> sink('/Users/linaskk/Library/Application Support/Rdaemon/r_tmp');cat(geterr
<ary/Application Support/Rdaemon/r_tmp');cat(geterrm essage());sink(file=NULL)
> sink('/Users/linaskk/Library/Application Support/Rdaemon/r_tmp');args(ls)
> sink(file=NULL)
> sink('/Users/linaskk/Library/Application Support/Rdaemon/r_tmp');cat(gsub('
<ary/Application Support/Rdaemon/r_tmp');cat(gsub('. *?/library/(.*?)/.*','\\1
<aemon/r_tmp');cat(gsub('.*?/library/(.*?)/.*','\\1' ,as.vector(help('ls',try.
<?/library/(.*?)/.*','\\1',as.vector(help('ls',try.a ll.packages=F)),perl=T),s
<as.vector(help('ls',try.all.packages=F)),perl=T),se p='\n')
> sink(file=NULL)
> ls()
[1] "jpeg" "pdf" "png"
>
I've used Rdaemon before on other systems running the same OS X 10.6.8 without a problem, so I am not sure why it doesn't work on this particular system. The same thing happens in both TM1 and TM2.
-Liisi
Hi,
I just noticed that the Avian fork of the Subversion bundle has the key equivalents (Control-Shift-A) removed from the commands. Not a big problem, I added them back. But I wondered, is there any reason for this?
enas
Hi,
here's a minimal Perl example :
$word_plus = "$word\t$last_word $word";
if($word =~ m/^maka/i) {
if(exists($maka_{$word_plus})) {
$maka_{$word_plus}++;
} else {
$maka_{$word_plus} = 1;
}
}
- fold if clause
- place the caret left of "if($word ..."
- press ↩ to insert a new line
and I got this:
The text buffer is correct only the display is wrong since I can unfold it and I get the correct if clause back. I also changed to Obj-C and other languages and it also occurred thus it's not language depended.
Cheers,
--Hans