Hello -
When doing a "Find" within a file, the found item(s) is highlighted
but there is not really enough contrast to make it quickly noticeable.
I find my myself having to scour over the document to locate where the
highlighted word or phrase is. Is there a way to change this, so that
when doing a "Find" the found item(s) shows up in yellow (or some
other bright color)? I am using the Mac Classic theme... I did not see
anything within the preferences for that. Thanks!
- Jorma
I recently switched to Mac from Windows.... I have specific
keybindings that I want to use. Specifically, I want cmd-y to delete
a line, cmd-d to duplicate a line, and shift tab to reverse indent
selected lines.
In most apps I've been able to get cmd-y and cmd-d to work by adding
this to the
~/Library/KeyBindings/DefaultKeyBinding.dict file
"@y" = ("selectLine:", "delete:");
"@d" = ("selectLine:", "copy:");
I don't know how to do the reverse indent.
These keystrokes work for most applications, but not for TextMate. I
have also tried this file: ~/Library/Application
Support/TextMate/DefaultKeyBinding.dict
Could someone point me in the right direction?
thanks
phil
Hi all,
Just bouncing this idea…
I would like to be able to active a directory withtin the project to
be the TM_PROJECT_DIRECTORY until deactivated or another directory
activated.
Use case: With maven it's common to have a master project with lots of
modules, sometimes you want to target a command to a particular sub
module, not the master module which is the TM project.
You could argue that the commands should be smart about using the
project drawer selection, but IMO this can be confusing when dealing
with multiple selections.
Thoughts?
LD.
I have to manipulate some PDF files directly so I was looking for a TextMate
Bundle for PDF/FDF files.
They have a pretty weird syntax, so I'm not sure which bundle might be
useful as a starting point. I have the PDF reference (1,310 pages of
excruciating detail) but I'm looking for something simple to at least make
some logical sense from this 'non-human-readable' language :)
Any pointers to a similar or even a partial bundle would be appreciated.
Thanks
Darryl Zurn
Sample PDF internal syntax (PDF 1.7 Reference, page 1059):
%PDF−1. 4
1 0 obj
<< /Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<< /Type Outlines
/Count 0
>>
endobj
3 0 obj
<< /Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
endobj
4 0 obj
<< /Type /Page
/Parent 3 0 R
/MediaBox [ 0 0 612 792 ]
/Contents 5 0 R
/Resources << /ProcSet 6 0 R >>
>>
endobj
5 0 obj
<< /Length 35 >>
stream
% … Page-marking operators …
endstream
endobj
6 0 obj
[ /PDF ]
endobj
xref
0 7
0000000000 65535 f
0000000009 00000 n
0000000074 00000 n
0000000120 00000 n
0000000179 00000 n
0000000300 00000 n
0000000384 00000 n
trailer
<< /Size 7
/Root 1 0 R
>>
startxref
408
%%EOF
--
View this message in context: http://www.nabble.com/Bundle-or-Language-Grammar-for-raw-PDF-syntax--tp1698…
Sent from the textmate users mailing list archive at Nabble.com.
Hi there,
sorry for getting offtopic, but I seek advise from all the Pros in here: I
am looking for a good JavaScript-Forum.
English language is very OK, Id be happy to find a german one.
More important is, that the board should be alive and its users are
advanced and encouraged.
The project Im working on is about basic AJAX and some JQuery.
Thanks in advance!
Dennis
When browsing documentation in a HTML preview window the hyperlinks
work as expected but I cannot find anything like the forwards/
backwards keys in a Web browser to retrace the path through the
hyperlinks. Do such keys exist?
Thanks,
Dave.
It's probably right in front of my face, but I've done a couple
searches, looked in the book and in the manual, and I can't find it...
Is there a bundle that provides the ability to open a URL that's part
of a plain text file (in a browser)?
--
Daryl
Allan,
I know, I know, 2.0 will be ready when it's ready. But can't you tease
us just a little? For example, let's say you have a todo list for 2.0
and you're working your way through it checking off items. Can you
tell us what percentage of that list is complete? It wouldn't really
give us any idea at all when the thing will be out, since that last
10% can take 90% of the time to develop and we don't really know when
you started on 2.0 anyway, nor what percentage of your time is devoted
to 2.0. But it would be a nice teaser.
(Not that there's anything wrong with 1.5.7...)
Fanning the vaporware flames,
j.
:-)
In another thread Allan Odgaard wrote:
> TextMate will not search binary files, granted it knows that the file
> type is binary. So right-click a file (using the extension you want to
> exclude) in the project drawer and select to treat it as binary.
That helps, but isn't perfect. For one thing, it can't handle files
without an extension, such as executables. If I just open a directory
as a project, it's likely to be a mixed bag of source, object, and
executable files. It's easy enough to tell TextMate to skip the object
(*.o) files, but how do I tell it that the executable named "xyzzy" is
binary?
There's another quirk related to filename extensions that drives me
nuts. For various reasons, I have a lot of files with the extension
"*.txt" which actually contain different types of data. We have, for
instance, configuration files, SNMP MIB files, and plain ol' text files
sharing that extension. I'd like different syntax highlighting rules to
be used for each. So I open "foo.txt" and change the language to
"MIB". Then I open "bar.txt" and change to "plain text", and so on. It
seems that every time I open a file with the *.txt extension I have to
fiddle with the language.
(Yeah, if it were up to me I'd give all these files different
extensions. Unfortunately the naming conventions were established long
before I was hired here!)
Since the majority of *.txt files I edit actually are plain text, I
think it'd be great if I could tell TextMate explicitly, "Treat *.txt as
plain text unless I tell you specifically otherwise" instead of having
it automatically change the definition of the whole extension whenever I
switch. I'd still end up changing types, but at least it'd cut down on
how often I'd need to. Bonus points for remembering which full filenames
have been manually mapped to something else.
What would be even better would be for TextMate to examine the contents
of the file as well as the filename to determine what language it is.
If the extension is ambiguous, check the first few bytes for a shell
shebang line, or an emacs-style modeline, or some other clue as to the
type. And I would absolutely swoon if the language definition itself
contained a way to specify what to look for, letting TextMate try each
language in turn until it found a match.
--
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>
Hi there.
I am getting an error when I try and use the Ruby on rails bundle in textmate.
When I'm in a class file and I select Bundles -> Ruby on rails -> Models ->
Show DB Schema for current class, the following error shows up in textmate:
/tmp/temp_textmate.01e34I:9: in 'require': No Such file to load -- /config/boot
(LoadError)
from /tmp/temp_textmate.01e34I:9:
from /tmp/temp_textmate.01e34I:9:in 'call'
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/progress.rb:3
6:in 'call_with_progress'
...
...
...
I am using Mac OS X Version 10.4.11, Rails 2.02 and Ruby 1.8.6.
If anyone has an idea how I could fix this problem, I'd really appreciate it.
Thanks
Gerard
Hi all,
I know that I can use Ctrl-Shift-> to cycle amongst the various forms
of <% %>, but it only seems to work on my full-sized keyboard. What is
the equivalent keyboard combination on a PowerBook (G4)?
Thanks,
Ian.
--
Hello,
Somewhere I saw a video where after a cite command and some initial
characters ( \cite{con}) a BibDesk search is invoked to make the right
selection for publication.
How is this BibDesk-Search and Completion used within TextMate?
Thanks
Christian
Thank you Paul!
You were correct, my MacPorts installation seems to have messed up the
tr command.
By explicitly setting it to the OSX path (/usr/bin/tr) within the drag
command, it is now working correctly.
Cheers,
Matt
> Hi Matt,
>
> When I drag an image, whether it be from the filesystem or the project
> > drawer, I get strange output where the alt tag should start.
> >
> > <img src="building.jpg" border="0" width="200" height="438" tr:
> > range-endpoints of
> >
>
> Just for the record it's working fine here (10.5.2, latest TextMate
> (1464))
> , which suggests to me that you might be bumping into a non-standard
> "tr"
> utility. That's certainly the point at which the command looks to be
> breaking. The string that you're seeing inserted in place of the
> "alt" looks
> like it comes from a linuxy tr, rather than the built-in /usr/bin/
> tr : what
> do you get when you enter
>
> which tr
>
> and then hit control-r within TextMate? If it's something other than
> /usr/bin/tr you can either adapt your PATH (see the TM manual) or
> explicitly
> point at the built-in version of tr (or move the impostor out of the
> way).
> Anyway, it's just speculation, but hopefully it sets you on the right
> track...
>
> Cheers,
> Paul
Hi,
I've done a basic search on Google but can't find anything specific about a
problem I'm having with Textmate, namely handling large textfiles or
textfiles with long lines.
It's driving me nuts. I'm having to deal with XML and HTML files which have
been 'compacted' so there are no carriage returns / line feeds and I want to
tidy them up in TextMate so I can make then human readable but TextMate just
takes forever to load the files. TextPad on the PC has no problems, but I
didn't switch to Mac for my Windows colleagues to point and laugh! :) Seems
like a basic capability of text editor that TextMate just can't deal with.
Had this been noted before? Is there a fix in the pipeline?
Thanks,
Ian.
--
Ian Kershaw
Save paper and the environment. Don't print this email unless necessary.
If you do, print up to four pages on one sheet with free software FinePrint
http://www.fineprint.com/
The default block comment in the PHP bundle is:
/*
Comment...
Comment...
*/
The industry standard seems to be this:
/**
* Comment...
* Comment...
*/
How can I change this in TextMate?
Hi all,
My apologies if this is a known bug - but a search didn't turn up
anything.
When I drag an image, whether it be from the filesystem or the project
drawer, I get strange output where the alt tag should start.
For example:
<img src="building.jpg" border="0" width="200" height="438" tr: range-
endpoints of
I haven't changed this drag command at all, and am using the latest
nightly "bleeding edge" build.
Not that big a deal, just checking to see if anybody knows anything.
Cheers,
Matt
I really don't like when I get to the lowest part of the screen
(wrote more than one page).
Now I normally add many blank lines after and center the screen,
but this is not very smart, and I think the
smartest editor of the world shouldn't do dumb things like that...
Any other ways??
THanks
Hi,
I get the following strange error when using ctrl shift G on a markdown
document that is part of a local Git repository:
/tmp/temp_textmate.fN7vjq:26 in `open': No such file or directory -
pages (ErrnoENDENT)
from /tmp/temp_textmate.fN7vjq:26: in `entries'
from /tmp/temp_textmate.fN7vjq:26
The weird thing is that if I change the language from Markdown to plain
text everything works as expected---no error message and the Git menu
comes up. With Select Bundle Item (ctrl cmd T) I checked and the ctrl
shift G is not being used by any other bundle. Not sure what is going on.
Best, Mark
On Apr 25, 2008, at 1:28 AM, Allan Odgaard wrote:
> On 23 Apr 2008, at 17:57, Thomas Allen wrote:
>
>> […]
>> I can't find a resource of all TM env. vars, but the PHP comments
>> preference
>> includes values of /* and */ for TM_COMMENT_START_3 and
>> TM_COMMENT_END_3,
>> respectively. What var can define my block comments' body?
>
> The generic Toggle Comment command is not designed to support the
> configuration of such style. But it should be fairly simple to
> create an overload which is only active in PHP mode, you can even
> write it in PHP: http://ciaranwal.sh/2008/04/04/textmate-tip-using-php-for-commands
> :)
>
I found this snippet a while ago:
${TM_CURRENT_LINE/(.*\*\/$)|.*?(\/\*(?!.*\*\/)).*|.*/(?1:
:
(?2: )* )/}
Activation: ↩
Scope Selector: source.php comment.block
This one lines up your * but I'm sure you could modify it to left-
align them all.
itp
Hi,
I just came up with an interesting question.
Imagine I have a TMProject. I structured my files in groups, etc. All
files are somewhere on my machine. Now I want to take this TMProject
with all files! to on other computer. How can I do this?
TMProjects only stores the pathes to the files but not the files by
themselves.
Thanks,
--Hans
Hi everyone,
I want my PHP comments to read:
/*
* Does something
* @param foo lorem ipsum...
* @return fubar lorem ipsum...
*/
instead of the default
/*
Does something
@param foo lorem ipsum...
@return fubar lorem ipsum...
*/
I can't find a resource of all TM env. vars, but the PHP comments preference
includes values of /* and */ for TM_COMMENT_START_3 and TM_COMMENT_END_3,
respectively. What var can define my block comments' body?
Also, is there a resource for all environment variables in TextMate?
http://macromates.com/textmate/manual/environment_variables feels incomplete
to me.
Thanks,
Thomas Allen
How do you export a theme that you have created? I created a copy of
blackboard, but even that copy will not show up in the themes folder of
textmate. Any help would be appreciated.
-Shoma
--
View this message in context: http://www.nabble.com/Exporting-themes-tp16815589p16815589.html
Sent from the textmate users mailing list archive at Nabble.com.
hi.
In my project drawer, i can click certain files and they open in the
textmate editor window: It's a Rails project, model files and other .rb
files are OK
but when I click on the files ending on .erb, nothing happens. For instance
a file in /app/views/reports/index.html.erb
It doesn't open. The only workaround i can figure out is to use command+T.
Did i unintentionally touch a switch? Am I overlooking something obvious?
I'm absolutely new to Textmate (bought my mac roughly a week ago) so please
point me to an obvious answer/link if possible.
/Jesper
PS. my version 1.5.7 (1464)
--
___________________________________________________________
Jesper Rønn-Jensen / Capgemini Denmark
Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201
www.dk.capgemini.com / Blog http://justaddwater.dk/
jesperrr(a)gmail.com (Private e-mail and Google Talk IM)
___________________________________________________________
Is there a way to customize which file types are hidden in the
project drawer? I notice that .pyc files are hidden automatically and
I'd like to do the same for java .class files.
If I get an answer on this (or figure it out myself) I promise to
document it on the wiki :)
Thanks!
Hi there,
the title already says it all: What i'd love to have is a status
indicator ('searching...') or a progress indictator ( 'x% of project
files searched') in the 'find in project'-window. I use it often on a
project of some thousand files on a network volume. Searching the
project always takes a few seconds (i'm cool with that) and i always
wonder whether textmate is already working or not because it doesn't
provide _any_ immediate feedback.
cheers,
Till Backhaus
---------------------------
Till Backhaus
mail: till(a)backha.us
blog: http://till.backha.us
Does anyone know if you can save your search results (in Find in
Project dialog), as a text file?
I tried selecting items in the dialog and copy and pasting into a
textmate document, but that doesn't work. I look at the manual online,
and it doesn't say anything about saving your search results.
It would be nice to get my results into it's own file. My situation
is that there are many instances of a particular email address(es) in
some webforms, and I'd like to give a nice list (like the dialog has)
to someone.
Thanks,
Kevin
The following is a legal and useful construct in Ruby:
begin
# do stuff
end until whatever
But TextMate's Ruby code folding rules don't grok it. Has anyone, offhand,
got a cure for this? Thx - m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
Hi
I am trying to add a clause to my PHP language grammar that only
affects a variable between square brackets/braces, for example it
would match $bar from the following
$foo[$bar]
The language block I have is this
var_index = {
name = 'variable.other.index.php';
match = '(?x)
\[(\$+)[a-zA-Z_\x{7f}-\x{ff}]
[a-zA-Z0-9_\x{7f}-\x{ff}]*?\b\]';
captures = { 1 = { name =
'punctuation.definition.variable.php'; }; };
};
The problem is that it affects the square brackets/braces as well as
the variable inside them. How do I alter it to only affect the
variable and not the brackets/braces?
Thanks in advance for any help
Teifion
––––––––––––––––––
http://woarl.com/blog
Hi,
We have to buy Textmate (2 licences).
I've red about a "2.0" version.
Is there a release date ?
If we buy 1.5 today, could we have for free the new version ?
Thanks
--
Nicolas (Leopard)
Hi,
The Git bundle is great, but the GUI tools don't seem to be working.
View Branch History with Gitk does nothing, though Gitk works from the
command line.
View history with Gitnub launches two empty GitNub windows. Again nub
works properly from the command line.
Git Gui does nothing as well. Fine on the command line.
I thought it might be a path issue, but running echo $PATH inside of
TM with ctrl R shows that the paths are fine...
Others on the irc have the same problem.
Best, Mark
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I just created a bundle for literate programming in cweb. You can
find the bundle here:
git://github.com/a-priori/cweb-tmbundle.githttp://github.com/a-priori/cweb-tmbundle
Currently, the bundle only has a language definition. Let me know
what you think of it, and send me any suggestions you have for how to
improve it.
Regards,
Michael Melanson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFID4fS5/wM81IeisIRAuwvAKCcOiRuZxdoLnuqD5uxb1A0W//tZwCdG45p
8e3J2EHrif3NwBC04tCwzXs=
=4vPH
-----END PGP SIGNATURE-----
Hi all,
Sorry if this has been asked before, but the instructions on the
textmate website don't work for me. If I open up bundle editor and try
to drag the bundle called "html" into my finder window, it won't let
me. Does anyone know a way of "manually" exporting a bundle, or
another alternative.
Thanks for any help.
Paul
Is there a way to customize the color of selected text? -- I.e., I want the foreground (text) color to be amber, but black when highlighted (the highlight itself would be another color, e.g., blue).
_________________________________________________________________
Express yourself wherever you are. Mobilize!
http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=e…
Is there a way to modify the Open Terminal command so that it uses
tabs with Terminal.app? I have been trying to do this but my
applescript-fu is weak. :/
Best, Mark
It breaks identically on my Leopard laptop at home. I noticed in Subversion
that there's a blurb about it not working in Leopard, and I just thought I'd
mention it's broken in Tiger too.
Quad G5 2.5Ghz 4G AM
Hope this gets resolved soon. I'm doing a bunch of groovy work and having
to cut/paste into GroovyConsole is a drag!
Thanks,
-Chris
--
Chris Patti --- Y!: feoh -- AIM: chrisfeohpatti --- E-Mail: cpatti(a)gmail.com
"FORTRAN is just really good if you're really, REALLY twisted. Because the
obscene things people do in FORTRAN are just horrible." - James Gosling
Dear DIALOG2 popup developer,
I have a problem ;)
I want to insert a character which could have several names like
↓ arrow down
← arrow left
↑ arrow up
α greek alpha
β greek beta
My aim is to write e.g. "arrow" and the popup dialog shows all arrow
matches (only the glyph). Then I want to choose one and instead of
inserting "arrow" it should insert the chosen glyph. Fine. I tried it
and I had partly success.
####
First problem:
for the suggestions I have to write:
{display="↓";match=down;},{display="↓";match=arrow;}
this leads, of course, to having two ↓ in the list.
Why not write:
{display="↓";matches=("down","arrow");}
In other words to allow more than one match.
####
Second problem:
If I want to do that I have to use the options -w for wait, because I
want to replace e.g. "arrow" by my chosen glyph. Fine. But if I delete
5 characters to show all suggestions I do not see what I'm writing
whereby the popup menu does its job perfectly.
####
Third problem:
If I type e.g. "arr" the popup dialog finds all matches beginning with
"arr". But it would be nice to have an option to show only those items
matching exactly. E.g. I have to type "arrow" to show all 'arrow's not
only "a" or "ar" etc.
##########
Here's a first naïve example command:
Input: Selected Text or Word
Output: Replace Selected Text
Command:
RES=$(echo '{suggestions=({display="↓";match=down;},
{display="↓";match=arrow;},{display="↑";match=arrow;},
{display="←";match=arrow;},{display="α";match=greek;},
{display="α";match=alpha;},{display="β";match=greek;},
{display="β";match=beta;});}' | "$DIALOG" popup -iwf
"$TM_CURRENT_WORD")
RES=$(echo "$RES" | grep display | perl -Xpe 's/.*?display = "(.*?)";/
$1/;s/\\U([0-9A-F]+)/chr(hex($1))/iesg;')
echo -n "$RES"
My overall aim is to provide a possibility to insert a glyph by
looking for words in its Unicode name.
Or is the DIALOG2 popup dialog not the right tool for it, meaning
should one write its own rountine for that?
Or is there a better way to do it?
Thanks a lot for any hints in advance!
--Hans
In my Ruby script which is called somewhat indirectly, I tried saying
`CocoaDialog blahblah` but it didn't work; evidently the indirectness means
that I'm not inheriting some path trickery from TM. So I changed it to this:
`#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog
blahblah`
That works. But is there a better way? Thx - m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
Hi--
This might already be doable in TM, and I just don't know it, but I
thought it might be worth mentioning in case it's new:
- Tear-off tabs. It would be great if, when working on a set of files
in tabs, I could just drag one over to the side, to have it in a new
window. Stacking in tabs works great in most cases, but occasionally,
it's necessary to see two files side-by-side.
- Many others have said this; I'll echo it: Split screen in
horizontal, vertical, and both directions (ala Emacs), both to
navigate the same file or different files in each pane.
- Advance to next tab bindings uses the ` key. Right now, Cmd+Option+-
> is the binding, and Cmd+` advances to next window. It would be
great if the default binding for advance to next tab was Cmd+Option+`
just to clear a few gray cells for other use :)
Just a few thoughts.
Hi,
imagine I have two documents open for Ruby or R. I wrote some scripts
and I know that these scripts are running for a while.
I select one doc and press APPLE+R and I switch to the other one and I
press APPLE+R. Fine. I see two HTML output windows working.
But just in the moment I switched to the second doc to execute it, the
first script finished its job. Thus my script from the second doc will
be shown in the same HTML window for the first document. And I had no
chance to read the result or error message.
How can I get rid of it. I thought maybe by naming the HTML windows
differently. But what will be the best way? Add a the starting time or
the name of my doc window?
But this leads to the problem that I want to have one HTML window for
one script. I do not want several HTML windows hanging around, I do
not know which belongs to which.
Is that possible in some way?
Many thanks in advance,
--Hans
hi all,
I found the "Hyperlink helper bundle" a very useful tool for creating
wikipedia and other links.
For some time now, however, running "Lookup Word / Selection on
Wikipedia and link" has lead to this error:
env: ruby\rrequire: No such file or directory
Has this function been rolled into another bundle or support dropped?
thanks for your help,
tim
FYI, the code is
#!/usr/bin/env ruby
require "#{ENV['TM_SUPPORT_PATH']}/lib/progress.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
require 'cgi'
require 'open-uri'
require 'erb'
def cap_all_words(string)
return string.split(" ").map{|w| w.capitalize}.join(" ")
end
def follow_redirect(page)
pagename = page.match(/var\swgPageName\s\=\s\"(.*?)
\";/).to_a[1].gsub(/\\'/,'%27')
url = %{http://en.wikipedia.org/wiki/#{pagename}}
content = open(url).read
return url, content, pagename
end #follow_redirect
def select_link(links)
linklist = links.map { |p| p[0] }
item = TextMate::UI.request_item :title => "Multiple
Definitions", :prompt => "Please select a definition", :items =>
linklist
TextMate.exit_discard if item.nil?
return links[linklist.index(item)]
end # select_link
def check_for_search(page)
TextMate.exit_show_tool_tip "No definition found" if page.match(/
<title>([^<>]*)<\/title>/i).to_a[1].include? "Search"
return page
end # check_for_search
def check_for_multiple_results(page,phrase,pagename)
if page.match(/(<\/b>\scan\sbe:<\/p>)|(<\/b>\smay\srefer\sto:<\/p>)/
i) then
open("http://en.wikipedia.org/wiki/Special:Export/#{pagename}") {|
body|
links = []
body.read.scan(/\[\[([^|\]]*)[|]?[^\]]*\]\]/) { |link|
links.push(link) }
choice = select_link(links)
TextMate.exit_discard if choice.nil?
TextMate.exit_replace_text(%{<a href="http://en.wikipedia.org/wiki/#
{CGI.escape(choice[0]).gsub('+','_')}" title="Wikipedia Entry:
#{choice[0]}">#{phrase}</a>})
}
end
end #check_for_multiple_results
def check_for_disambiguation(page,phrase,pagename)
# if page.match(/#{phrase}[\s]?\(disambiguation\)/i) then
if page.include? "(disambiguation)"
# findlink = page.match(/\"(\/wiki\/#{pagename}_%28disambiguation
%29)\"/i)
# open("http://en.wikipedia.org#{findlink[1]}") {|body|
open("http://en.wikipedia.org/wiki/Special:Export/#{pagename}_
%28disambiguation%29") {|body|
content = body.read
links = []
content.scan(/\[\[([^|\]]*)[|]?[^\]]*\]\]/) { |link|
links.push(link) }
choice = select_link(links)
TextMate.exit_discard if choice.nil?
TextMate.exit_replace_text(%{<a href="http://en.wikipedia.org/wiki/#
{CGI.escape(choice[0]).gsub('+','_')}" title="Wikipedia Entry:
#{choice[0]}">#{phrase}</a>})
}
end
end #check_for_disambiguation
def getWikiDef(phrase)
TextMate.call_with_progress(:title => "Contacting
Wikipedia", :message => "Looking for definition of #{phrase}") do
escapedUrl = "http://en.wikipedia.org/wiki/Special:Search?
search=#{CGI.escape(phrase).gsub(/\\'/,'%27')}"
@response = open( escapedUrl,
"User-Agent" => "TextMate 1.5.5")
content = @response.read
if content.scan(/Redirected\sfrom/)
url, content, pagename = follow_redirect(content)
# confirmed = TextMate::UI.request_confirmation :button1 =>
"Accept", :button2 => "Cancel", :title => "Redirected to \"#{pagename}
\"", :prompt => "Accept Redirection?"
# TextMate.exit_discard unless confirmed
else
url = @response.base_uri
pagename = phrase
end
check_for_search(content)
check_for_multiple_results(content,phrase,pagename)
check_for_disambiguation(content,phrase,pagename)
title = "Wikipedia Entry: " + pagename.gsub(/_/, ' ')
return url, title, phrase
end
end
url, title, input = getWikiDef(STDIN.read)
print ERB.new(ENV['TM_LINK_FORMAT']).result
Hi,
I experience a problem with keybindings and the LaTeX bundle.
Specifically, the command "Insert Environment Based on Current Word"
does not get activated if I hit the corresponding key sequence (but I
can still activate it from the menu).
Other commands (such as "Insert Command Based on Current Word") work
perfectly, however.
I checked my Mac OS X keyboard preferences, and the corresponding key
sequence does not appear in the keybindings there. Perhaps someone had
this problem before, and can enlighten me about this issue.
Thanks in advance
Nicolas
I don't understand why every time I paste something (from external
programs or even textmate itself) it always indents it of at least one
level.
Is it done on purpose?
Any way to disable this?
Hi,
I'm trying to make RubyAMP (not hosted at macromates.com) work.
I installed rb-appscript using "sudo gem install rb-appscript", but
when I try to run with TextMate and require it in a script, it shows
me an error "LoadError: no such file to load ― appscript".
In irb, I could get "true" to require 'appscript'
irb(main):003:0> require 'rubygems'
=> true
irb(main):004:0> require 'appscript'
=> true
My ruby script is as simple as:
p require('rubygems')
p require('appscript')
and if I run Command-R, it fails to load appscript.
The script
require 'rubygems'
puts Gem.path
returns
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8
/Library/Ruby/Gems/1.8
My ruby version is: ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-
darwin9.2.0]
gem version is 1.1.1
The gem is installed at `/usr/local/lib/ruby/gems/1.8/gems/rb-
appscript-0.5.1`.
I'm running Mac OS X 10.5.2 on an Intel-based MacBook.
Looks like I need to add a gem path to TextMate(?)
Any help would be appreciated.
Takaaki
--
Takaaki Kato
http://samuraicoder.net
Dear community,
I am newly trying out Textmate, which I intend to use primarily with
LaTeX, with the hopes of possibly switching permanently from my
current text editor, TexShop. But I cannot get either the forward or
backward search function of pdfsync to operate with Skim, my
preferred viewer.
I have already done the following:
1) Selected Skim as my viewer in the Textmate preferences.
2) Selected "View in Skim" from the LaTeX preferences in Textmate.
3) Synced (from inside Skim preferences) with Textmate.
4) Put the pdfsync.sty file in \user\texmf\tex\latex
5) Inserted the \usepackage{pdfsync} in my document.
6) Attempted forward search with "shift-command-click" and backward
search with "Show in Viewer (pdfsync)".
Interestingly, the .pdfsync file, which is full of numbers that
describe the document geometry, is created in the current
directory... my understanding is these numbers are what is used to
locate one's position in forward and backward search. But the
functionality is certainly missing.
(Note: I am trying to run all these programs on a PowerPC-based
Powerbook G4.)
Any assistance in resolving this issue would be GREATLY appreciated.
I have scoured the internet and discussion groups in search of an
answer, but I cannot seem to fix this error.
Thanks in advance,
Yaniv
The minimal test case below shows that something in the parsing of the
newenvironment command is throwing off the syntax coloring by the
LaTeX bundle, at least on my system (TM 1.5.7 1464 on Leopard). The
text in the document is incorrectly parsed as being in a math
environment.
\documentclass{article}
\usepackage{amsmath}
\newenvironment{choice}
{\left\lbrace\begin{gathered}}
{\end{gathered}\right\rbrace}
\begin{document}
Text incorrectly parsed as being in a math environment.
\end{document}
-----
Any ideas of how to fix the parsing?
--
Kai von Fintel
fintel(a)gmail.com
If I have a single file open, is there an easy way to create a new
project with an existing file + the current file? I was hoping to
find a menu item, or key combination that will give a file dialog to
select new file(s) that would be added to a new project that includes
the current file.
--
Kevin Horton
Ottawa, Canada