Just upgraded to TextMate 2 (have not used TextMate in a while, glad to be back :-)
I’m also starting to try and due Rails development in TextMate. The Rails Bundle is dated, and so is only partially usable. I would like to start “fixing” that in my spare time. One thing, though, that would be nice, is the ability to edit Ruby code in the Bundle Editor. The files show up, but I cannot click on them. The only way I can edit is “mate …” from the command line the files I want to modify.
Not a big deal, but would be nice.
Is there any way to show the SVN new/modified/deleted lines on the editor, just like the Modific plugin (https://github.com/gornostal/Modific)?
I mean, some kind of line badges/colors to highlight the changes.
Thanks,
Rubén
Hello Everyone,
I've been participating in a thread on GitHub
(https://github.com/deplorableword/textmate-solarized/issues/52) that
has identified the selection of text in the Solarized Dark theme as a
real issue. It seems that implementation of
selectionForeground/selectionBackground may be one solution for the
frustrating issue. I wanted to see if there was a wider desire for a
solution to this problem here, and perhaps if there was more support for
the implementation of selectionForeground/selectionBackground.
Thanks,
Alex
I found a strange behavior that I believe is a bug. I am using 2.0-alpha.9503 on OS 10.9.1.
First I redefined the keyboard shortcut for "Comment Line" in the system Preferences. This command is from the "Source" bundle and appears as alternative shortcut to the default ⌘/ in the bundle menu (I used ⌘- in order to avoid the rather clumsy command for german keyboard layout).
Right after that both shortcuts work fine. After closing and reopening TextMate, only the default shortcut ⌘/ works, the new shortcut is now ignored.
When I select Bundles -> Source -> Comments I can see that the commands are still set correctly. After that, both shortcuts work again, until I close TextMate and open it again: the new shortcut is ignored until the menu selecting Bundles -> Source -> Comments is opened up, after that it works till closing TextMate again.
I was struggling some time with this issue, without solution. Now after testing for writing this bug report, at least there is a simple workaround. But maybe it can be resolved. I also tried changing the Bundle "Source" itself, but that didn't do the trick either.
Martin
I've found this great BlurMate plugin today for TM2.
https://github.com/cliffrowley/blurmate
It works great, I just wonder since it's just a few lines of code,
why background blurring is not included in TM2 already?
I always loved the blur in Terminal and thought that TM2 is not capable of it.
Found the plugin just by accident.
Some way to set the blur using "defaults" for example would be nice.
On 15 Aug 2014, at 18:37, riki wrote:
> Please find herewith my custom theme.
> […]
I do not see any issue here.
I saved your theme and switched to it. Then changed langauge to Fortran
— Modern and entered ‘recursive’. This keyword is shown in bold
and with a slight color change (rather subtle though).
The rule in my Fortran grammar does btw not include as many keywords as
yours. Did you edit the grammar? Did you verify that you get the storage
scope (using ⌃⇧P)?
In a .tex file, typing sec + tab prints code for a section header and label. Very handily, the label for the section header syncs with the actual section header the first time the section is typed. However, thereafter, if the section header changes, the label doesn't change. Is it possible to always have the label change whenever the section header changes?
Many thanks
Ross
Hi,
We’re writing a booking (currently LaTeX) and I’d like to be able to use TM themes in the code listings.
Any solutions for that?
We’re using LaTeX packages “listings” + “color” to do the syntax highlighting. It allows statements such as this:
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
Pretty basic… Anyone seen anything better (pygments?) Or even a way to convert themes to this style?
Thank you, and best wishes,
tim
TextMate has keyboard shortcuts to show the file browser
(option+control+command+D) and switch focus to the file browser
(option+command+tab), but I cannot find a keyboard shortcut to open a file
from the file browser. The only way I can find for opening a file from from
the file browser is by clicking on the file with the trackpad. Is there a
keyboard shortcut available to open files from the file browser?
Cheers
Ross
Hi,
I came across with a rendering bug,
to reproduce it copy the following two lines and paste them into a TM document:
587 3 402 ̃ wa:w.4 NULL NULL NULL NULL
591 3 402 kha:ŋ.4 kha:w.4 NULL NULL NULL NULL
On my machine OSX 10.9.1 TM 2.0-alpha.9503 these lines are rendered as shown in that picture:
The "problem" seems to be that TM is not able to get rid of a TAB {utf8: 09} (and I believe this's true for each CONTROL character) followed by a combing diacritic - in that case a combining tilde {utf8: CC 83}. The actual data in the TM window are correct, you can e.g. look for TAB characters. If you remove the combining tilde TM renders the text correctly.
I'm aware that this is actually my fault since a combining character shouldn't appear after a control character and "more actually" I'm glad that TM had this bug thus I could find my fault ;) but I think TM should do it like other Mac apps e.g. TextEdit.
For safety reasons I attached a UTF-8 text file containing both lines.
Cheers, Hans
I want to modify the regex in the PHP language bundle item that applies the meta.embedded.sql scope to a string. I did this successfully in TM1, but with TM2 I opted to start with a fresh set of bundles and have been having trouble adding this functionality back in.
The PHP code continuing a string of SQL is this:
$db->query("
UPDATE table
SET foo = bar
WHERE foo = '" . function($variable) . "'
");
I tried many variations of the following, added just below the existing meta.embedded.sql rule:
{ name = 'meta.embedded.sql';
begin = '(\$db)->(query)\((")';
end = '(\3)\);';
beginCaptures = {
0 = { name = 'variable.other.php'; };
1 = { name = 'meta.function-call.object.php'; };
2 = { name = 'string.quoted.double.php'; };
};
endCaptures = {
0 = { name = 'string.quoted.double.php'; };
};
contentName = 'source.sql';
patterns = ( { include = 'source.sql'; } );
},
I've even tried simplifying it with only the 'name,' 'begin,' and 'end' and the scope isn't applied where I'd expect it. I can't see why.
I also found this rule (here is only a portion), which I thought I would modify:
name = 'string.quoted.double.sql.php';
begin = '"\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b)';
I tried changing this to:
begin = '"[\s\n\r]*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b)';
so that it would match the code example above, but the regex doesn't seem to be matching over multiple lines; it only works if the quote mark is on the same line as the UPDATE.
Can somebody please show me how to do this (with whichever of the above rules is more better)?
Once I get a working rule, I would like to add this to a custom bundle that includes the default PHP grammar and adds this modification to it so that I have a stock PHP bundle that is unmodified. Does anybody have an example of an extended PHP bundle so I can see how this should be done?
Thanks thanks,
Quinn
I¹ve upgraded to Yosemite beta and cannot save files. If I try to save a
file, a box pops that says the following:
Failure running ³Strip trailing whitespace on save². interpreter failed: No
such file or directory
What can I do to resolve this?
Thanks
Ross
I’m currently updating the RSpec bundle’s readme. The most important
(and also most complicated) part deals with how to run RSpec examples
from TextMate using the correct versions of Ruby and RSpec.
I’d love to get feedback on this. Here is the current version (work in
progress, the relevant section is the one titled “Supports RSpec 1, 2
and 3“):
https://github.com/rspec/rspec-tmbundle/blob/update-readme/README.md
(Topics like “How do I get TextMate to use rbenv for running my Ruby
scripts” have popped up several times on this list, so this may be
interesting even for people not using RSpec.)
Feel free to add any suggestions or corrections to the pull request at
https://github.com/rspec/rspec-tmbundle/pull/80
Thanks!
Stefan
Today I tried to install a bundle via Preferences → Bundles, but it
didn’t work: When I click on the checkbox the statusbar says “Installing
…” for some moments before changing to “Installed …“, but the checkbox
is unchecked (and the bundle has indeed not been installed).
Tried everything from
https://github.com/textmate/textmate/wiki/Reverting-To-Defaults, but
didn’t seem to make a difference. Tested in alpha.9551 and alpha.9553.
Any ideas?
Stefan
I attempted to build the MacPorts textmate2 port, originally for 2.0-alpha.9537, and got an "unknown signee" error during configure when it attempted to download the bundles.
I reported it on MacPorts Trac: https://trac.macports.org/ticket/43466. That ticket contains the steps I took and also now contains what I did to get the build to work.
My problem seems very similar to
http://lists.macromates.com/textmate/2013-February/035922.htmlhttp://textmate.1073791.n5.nabble.com/Unknown-signee-errors-td25943.html
and
http://permalink.gmane.org/gmane.os.apple.macports.tickets/68860
I think that there might be a couple of issues in key_chain.cc.
In file key_chain.cc, the line
if(err = SecItemImport(data, NULL, &type, &format, 0, ¶ms, NULL, &items) == errSecSuccess)
causes variable err to be set to the result of the logical expression, whereas the intent is to set it to the return value of SecItemImport. Needs either parentheses or splitting into an assignment and an if(). I chose the latter as in the diff output below.
Also, the documentation for SecItemImport (at https://developer.apple.com/library/mac/documentation/security/Reference/ke…) shows that the sequence of parameters &type and &format is wrong. I reversed them.
These changes didn't fix the problem but at least showed that SecItemImport was returning errSecAddinLoadFailed. On a hunch, I changed both &type and &format to pass the "unknown" enum and that fixed the problem.
I've included below the diff of the resulting changes, with a long comment added explaining that I didn't investigate whether both &type and &format needed to be changed or just one. If I had to guess, I'd say it was &format.
I have no idea why this was a problem for me and not for others.
The diff:
*** /tmp/key_chain.cc 2014-06-12 15:55:45.000000000 +1000
--- /tmp/key_chain.cc_orig 2014-06-12 15:55:45.000000000 +1000
***************
*** 31,56 ****
bool res = false;
SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };
! /*****************************************************
! /* Specifying the expected Item Type and Format
! * caused SecItemImport to return
! * errSecAddinLoadFailed.
! * I didn't check whether it was due to both being
! * specified or just one. Setting to the Unknown enum
! * worked.
! * Original code on next two comment lines.
! /* SecExternalItemType type = kSecItemTypePublicKey;
! /* SecExternalFormat format = kSecFormatPEMSequence;
! * Updated code with both vars set to unknown on next
! * two lines. */
! SecExternalFormat format = kSecFormatUnknown;
! SecExternalItemType type = kSecItemTypeUnknown;
CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
CFArrayRef items = NULL;
OSStatus err;
! err = SecItemImport(data, NULL, &format, &type, 0, ¶ms, NULL, &items);
! if(err == errSecSuccess)
{
_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
if(_sec_key != NULL)
--- 31,43 ----
bool res = false;
SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };
! SecExternalItemType type = kSecItemTypePublicKey;
! SecExternalFormat format = kSecFormatPEMSequence;
CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
CFArrayRef items = NULL;
OSStatus err;
! if(err = SecItemImport(data, NULL, &type, &format, 0, ¶ms, NULL, &items) == errSecSuccess)
{
_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
if(_sec_key != NULL)
regards - David
I was looking through the fork's of the original Handlebars and bundle
(which doesn't work very well anymore in 2.x land). Anyway, found this:
https://github.com/savetheclocktower/Handlebars.tmbundle
which on appears to be written in a very thoughtful way and geared
specifically for 2.x but unfortunately it doesn't work perfectly for me and
I'm too busy at the moment to dig into it. Does anyone else have any
bundles that work well for Handlebars?
ken
p.s. the problem I'm having is that while block commands like #each are
being highlighted correctly the more basic {{foobar}} variable
substitutions are NOT being highlighted.
Is anybody else having trouble using the default "Replace Conflict With Older Text" and "Replace Conflict With Newer Text" macros? They don't seem to work for me.
If I try to record a new macro, it doesn't remember the 'replace' value. That is, it works until I run some other search/replace command then my new macro for resolving conflicts just runs the last-used replace value. The macro I recorded contains this:
(
{ argument = {
action = 'findNext';
findString = '(?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n)';
ignoreCase = :true;
regularExpression = :true;
wrapAround = :true;
};
command = 'findWithOptions:';
},
{ command = 'replaceAllInSelection:'; },
)
See, no replace value. So I added a 'replaceString' item manually:
(
{ argument = {
action = 'findNext';
findString = '(?m:<<<<<<<[^\n]*?\n(.*?\n?)=======\n(.*?\n?)>>>>>>>([^\n]*)\n)';
ignoreCase = :true;
regularExpression = :true;
wrapAround = :true;
replaceAllScope = 'document';
replaceString = '$1';
};
command = 'findWithOptions:';
},
{ command = 'replaceAllInSelection:'; },
)
But it doesn't use this value, only the last one used in the find dialog box.
Any ideas?
--
Quinn Comendant
Strangecode, LLC
http://www.strangecode.com/
+1 530 624 4410 mobile
+1 530 636 2633 office
@qc and @strangecode
I often paste some crap from some terrible MS Word document into Textmate
and then into something else. Don't inquire as to the unholy nature of my
burdens such that I'm doing this work, just be thankful it's not you.
Is there a bundle that will clean up those awful fancy double quotes,
ellipses, etc, that Word likes to use into plaintext versions? It'd be
great.
Thanks all! Long live TextMate.
--
Wells Oliver
wellsoliver(a)gmail.com
The markdown-redcarpet bundle [1] supports fenced code blocks with
syntax highlighing, for example for shell scripts. The grammar pattern is:
fenced_block_shell = {
name = 'markup.raw.block.markdown.fenced';
begin = '(^|\G)([`]{3})[ ]*(?:bash|shell|sh)$';
end = '(^|\G)([`]{3})(\n|\z)';
patterns = ( { include = 'source.shell'; } );
};
This works fine, unless if have a block like:
```shell
dd bs=1m if=foo.img of=/dev/disk1
```
Here, “if” starts the scope “meta.scope.if-block.shell”, and this scope
extends beyond the ``` the end of the fenced code block, resulting in
incorrect highlighting for the rest of the markdown file.
Is there a way to include grammars in a way making sure the included
grammar does not extend beyond the “end marker” in any case?
And: Could the rule for if-blocks in the shellscript bundle be more
strict (matching only '^\s*if\b' for example)? Is this rule needed at
all? (I haven’t found any other references to the scope “if-block” in
the shellscript bundle.)
Stefan
[1]: https://github.com/streeter/markdown-redcarpet.tmbundle
I’m now one of the maintainers of RSpec’s textmate bundle. We just fixed
a bunch of issues, so if in the past you experienced problems with the
bundle please try again with the latest version.
Feel free to submit any issues you encounter at
https://github.com/rspec/rspec-tmbundle/issues/
I’m also thinking of removing support for RSpec 1 – if you’re still
using the bundle with RSpec 1 please chime in at
https://github.com/rspec/rspec-tmbundle/issues/78
Stefan
My bundles have been broken since the change to specify ruby18 ("Point to ruby 1.8 shim”, e.g. https://github.com/textmate/source.tmbundle/commit/8b80da05 . I understand the PATH changes, but it’s not a path issue — there is no “ruby18” executable on my system at all. I DO have Ruby 1.8.7 installed (with rbenv), just no `ruby18`.
Wondering if my system is an outlier, or if others have experienced this? What is the “shim” that ruby18 should be pointing to?
Thanks,
David
I'm using the TextMate version 2.0-alpha.9551 build and wanted to make sure
I had the latest version of JSLintMate. I deleted the existing bundle from
within Textmate and then downloaded and installed the latest bundle by
double clicking the bundle file/package. That seems to work in the sense
that it pops a dialog to install the bundle and the bundle file is then
locatable in:
Application Support → Avian → Pristine Copy → Bundles
The problem is it doesn't show up in the bundle menu. I've tried a restart
but that didn't help. Any idea why I'm not getting the bundle registered?
Ken