Is discontiguous text selection possible with TextMate?
On a somewhat related note (this is a long shot...), does anyone have
any idea what the -[OakTextView setMarkedText:selectedRange:] method
is supposed to do? I can't seem to have it make any effect on my
OakTextView...
Todd Ditchendorf
Scandalous Software - Cocoa Developer Tools
http://scan.dalo.us
I have been using different approaches to Transpose chars and
transpose words in AlphaX for a long time.
The usual way is really annoying, it swaps the chars around the
cursor. In the Cocoa (emacs-like) version it is also not symmetric:
if you do it two times the result is not the original (!)
Usually you notice you made a mistake after you have written the
chars. It is annoying to need to position yourself between the last
two chars to swap them.
The approach I use (and many Alpha users) is
transpose the last really chars, though spaces or parenthesis, etc
could be in between the cursor and the last two chars!
transpose word in this way is even better, since it also can swap
function arguments, etc.
Here I send the source for this to commands:
---------------------------- transpose chars ^T (v)SelecText|line (^)
ReplaceSel
#!/usr/bin/env ruby
sel = ENV['TM_SELECTED_TEXT']
if sel != nil
sel = sel.dup
sel.gsub!(/^(\w)(.*)(\w)$/u, '\3\2\1')
print sel
exit 0
end
left = ENV['TM_CURRENT_LINE'][0, ENV['TM_LINE_INDEX'].to_i]
right = ENV['TM_CURRENT_LINE'][ENV['TM_LINE_INDEX'].to_i .. -1]
left.gsub!(/(\w)(\W*)(\w)(\W*)$/u, '\3\2\1\4')
print left + right
----------------------
---------------------------- transpose chars ^-Opt-T (v)SelecText|
line (^)ReplaceSel
#!/usr/bin/env ruby
sel = ENV['TM_SELECTED_TEXT']
if sel != nil
sel = sel.dup
sel.gsub!(/^(\w+)(.+?)(\w+)$/u, '\3\2\1\4')
print sel
exit 0
end
left = ENV['TM_CURRENT_LINE'][0, ENV['TM_LINE_INDEX'].to_i]
right = ENV['TM_CURRENT_LINE'][ENV['TM_LINE_INDEX'].to_i .. -1]
left.gsub!(/(\w+)(\W+)(\w+)(\W*)$/u, '\3\2\1\4')
print left + right
--------------------------------
I use a lot a command that I call "quickSearch" that look for the
next text equal that the one that is selected. It is very useful
since you can find quickly var declarations, etc. only selecting the
word (you'll need only the keyboard!) and press, for exmple Shift-
Ctrl-Opt- -> or Shift-Ctrl-Opt- <- (arrow keys) for
quickSearchBackward.
The only way I've found is building the macro:
copySelectionToFindPboard:
findForward:
or the analogous for findPrevious:
The problem is with this simple action I destroy the FindPboard and
this is an unnecessary, I think, colateral effect.
Have s/o solve this not destroying the FindPboard?
Another:
I love to reread the last closed file in a time sorted (stacked)
way: last closed file, first one to open. This also allows me to
open several files (and close) them quickly.
I used to use Ctrl-Opt-O for that process in AlphaX. I can't find
the way for doing this with TM. I think you should save in a file
the history of open files, or so... TM haven't memory variables, in
any way. Alpha has an embedded interpreter inside it and then read
many many procs and variables at start and is easy to refer to them
and also has open-hook and close-hook procs that make this stack
very easy.
Any idea?
-- juan
Hello everyone,
I'm new to many things here -- textmate, regular expressions, etc,
etc. so I hope this isn't too far off topic for this list (apologies
in advance if it is). I'm trying to figure out how to do something
using find/replace. I have a long bibliography that was sent to me
as a single line of text. I'm trying to find a quick and elegant way
to insert line breaks between each of the individual citations.
Here is an example of the text I'm working with:
> Baddeley, A. "Working Memory." Science. 255: 556-559,1992. Baecker,
> R. J. Grudin, W. Buxton, et al. Readings in Human-Computer
> Interaction: Toward the Year 2000. USA: Morgan Kaufinann
> Publishers, Inc. 1995. Bevirt, B. "Designing Hypertext Navigation
> Tools.'' Digital Information Group, National Center for Atmospheric
> Research web site: < http://www. schlucar/dig/bra.inb/design/
> navtool.D.html>. 1996. Chandler, P. and J. Sweller. ''Cognitive
> Load Theory and the Format of Instruction." Cognition and
> Instruction. 8: 293-332, 1991. Chandler, P. and J. Sweller. 'The
> Split Attention Effect as a Factor in the Design of Instruction."
> British Journal of Education Psychology. 62: 233-246, 1992.
I'm just figuring out how to use regular expressions (sorry, not a
programmer) and I've been able to successfully select the endpoint of
each of the citations using:
\d{4}\.\s
My problem comes about when I try to replace the space represented by
\s with a carriage return. I'm not sure how to structure this in the
find/replace dialogue. Is anyone willing to point me in the right
direction here? I'm hoping to end up with something that looks like:
> Baddeley, A. "Working Memory." Science. 255: 556-559,1992. Baecker,
> R. J. Grudin, W. Buxton, et al. Readings in Human-Computer
> Interaction: Toward the Year 2000. USA: Morgan Kaufinann
> Publishers, Inc. 1995.
>
> Bevirt, B. "Designing Hypertext Navigation Tools.'' Digital
> Information Group, National Center for Atmospheric Research web
> site: < http://www. schlucar/dig/bra.inb/design/navtool.D.html>. 1996.
>
> Chandler, P. and J. Sweller. ''Cognitive Load Theory and the Format
> of Instruction." Cognition and Instruction. 8: 293-332, 1991.
> Chandler, P. and J. Sweller. 'The Split Attention Effect as a
> Factor in the Design of Instruction." British Journal of Education
> Psychology. 62: 233-246, 1992.
Thank you for any help you can offer.
--
j.
Is there any way to access the commands (API?) that are listed when
you build and then saving a Macro?
I think accessing them should make the programmer live really easier.
For example, you could send to TM, from an scripting program, a
sequence of such commands and TM could easily interpretate them.
-----
Juan
juanfc(a)lcc.uma.es
Hi
You're a thief! ;)
OK I did what you said and made some improvements to the Bundle. I
like to share what i did with others! Maybe you want to implant it in
the Bundle.
But in the meanwhile i have some problems here:
1. There are to main Forum Softwares out there which the people (and
me) use most. The one is vBulletin and the other is phpBB. These two
have slight differents in their way reacting to BBCode. For example
Lists and Links.
vBulletin writes a link like this:
[URL=http://www.examplesite.com]Please visit this great Page![/URL]
phpBB writes:
[URL="http://www.examplesite.com"]Please visit this great Page![/URL]
(with quoation marks for the URL)
How do i get rid of this problem? Or do i have to expand the Bulletin
Board Language for this to work?
2. This one is quite easy i hope ;) How do i make a submenu from
quite similar items? Like all the List items i want to appear in the
List submenu and so on.
Thanks for your help!
Zettt
Is there some way for telling TM to highlight the HTML "braces" like
<p> Lorem ipsum dolor sit amet, consectetur </p>
etc.
I think the way should be highlightPairs in Grammar, but why nobody
haven't do it yet?
(is it possible?)
Fellow textmaters,
I have been playing with the blogging bundle now for quite some time
and would love to see the following additions:
(I currently am at SVN revision 6430, my blogs are running Wordpress)
1. As I am writing un multiple blogs, I would really appreciate if
e.g. the category tab trigger would read my current post to see if
there is already a selection of blogs instead of asking me which blog
to post to, at the very least use a popup instead of the dialog (as
is done with the blog tab trigger)
2. Same goes for selecting categories… would there be a way to cache
the list of categories, maybe?
3. Is there a way to post drafts? Or, if not, is it possible to post
at future dates, so I can prepare and upload my next few posts
without needing to do copy/paste?
4. Is the common "linking" code progressing? e.g. if you insert a
link to a recent blog post (btw a great addition!) it inserts a HTML
link, but I am writing in markdown – so it is quite a pain in my eyes
to see the full clutter of <a> tags…
5. I very much love the "insert google lucky hit" functionality!
6. Image upload is soo cool!
Thanks again to all who are contributing to all those cool bundles!
Dan
Sorry if this is an obvious noob question, I've searched the help and
all the menus and can't find what I'm looking for, so I thought I'd seek
help here.
I'm in the process of "switching to a Mac" and currently weaning myself
off Topstyle Pro and so far I'm loving TextMate's workflow, one thing I
miss though is a way to move the cursor from the start of a section to
the end, e.g Topstyle allows for placing the cursor in a starting tag
pressing ctrl+M and the cursor will jump to the end tag (and back again
if you press ctrl+m again), it does this for {} in PHP as well and I'm a
bit lost without it, as it's the quickest way for finding those badly
nested tags...
I'm aware I can collapse and expand folds, but it's not quite the same.
is there a quick way to create this functionality?
or is it there already and I missed it?
Thanks in advance
;)
--
Join me: http://wiki.workalone.co.uk/
Thank me: http://www.amazon.co.uk/gp/registry/1VK42TQL7VD2F
Engage me: http://www.boldfish.co.uk/portfolio/
I can adjust my print font size by shrinking my display font size way
down, but is there another way? Or can you specify a default font size
delta between display and print?
Thanks
pth
I use the CTags bundle frequently. Thank you to its creator!! But I'm
having an issue now. When I press the key sequence to look up a symbol, the
file with the symbol is loaded in a new window, not as a tab in my project.
Why is this? It just started doing this recently.
Thanks,
Ernest
--
View this message in context: http://www.nabble.com/CTags-bundle-issue-tf3184686.html#a8839142
Sent from the textmate users mailing list archive at Nabble.com.
Hey folks. I'm testing out the tm demo for using with rails, but i'm
having a weird behavior on the Rails -> Go To file keystroke (command
option shift down).
It seems to work when I have a view file open, and will send me back
to a controller. But if I have a controller open, it does not
respond... could somebody sanity check me? (by not respond, I mean
the context window does not pop up).
Thanks,
Chris
When I typeset and view a LaTeX file I get this message:
The document file://localhost/RegionalEE.pdf couldn't be loaded
The LaTeX comes from a working copy of an SVN repo and consist of
multiple .tex files with a master document.
The error comes with PDFView and the standard viewer. But PDFView
eventually opens the correct file anyway.
I think it is related to the TM_LATEX_MASTER setting. But was is wrong with
TM_LATEX_MASTER=RegionalEE.tex
I just hope it doesn't have to include a hard coded directory.
Thomas
Howdy
When I do a pastie and hit escape at the tm_dialog thing
it does a pastie paste and IM's it to the first person on the IM list.
That ain't hip
thomas Aylott — design42 — subtleGradient — CrazyEgg
Hi There.
Can anyone help me with the Blogging Bundle for Nucleus? I can’t get
it to work. I’m using:
“http://....@www../nucleus/xmlrpc/api_metaweblog.inc.php#2″
and "...server.php#2"
for the setup.
But nothing’s happening.
Thanks in advance.
Greetz Dink
If you're writing a bundle that needs its own nibs, but needs another
bundle's libraries, is there a way to determine if and where those
libraries are stored on the users system? A series of fallbacks,
perhaps?
I figured out how to do a fuzzy search using stemming, but had to
create a small bundle to pull it off. It depends, however, on the
endpoint functions in the blogging bundle, so at this point I have
blogging bundle's lib directory copied into the Autotag bundle. Is
this unacceptable?
Thanks,
Brett
hi there,
sorry if this question was asked before, but i am new to the list
and did not found something like that in the archive.
i would love to have highlightPairs for ruby in such a way that:
{ highlightPairs = (
( 'def', 'end' ),
( 'def', 'return' ),
( 'class', 'end' ),
( 'begin', 'end' ),
( 'if', 'end' ),
( 'if', 'else' ),
( 'else', 'end' ),
);
}
would render a result. but as the documentation states the
mechanism of highlightPairs is restricted to 'characters'.
now obviously we do not have (use) braces and such for blocks
in ruby.
my question is: how can i implement a mechanism which tells
me my current scope.
frank'annoyed by accidental parse errors'waldheim
p.s.: if this question is complete bogus please just
let me know by replying a 'rtfm'
--
\|/ ____ \|/
@~/ ,. \~@ "When you are going to die,
/_( \__/ )_\ a wombat is better than no company at all."
\____/ [waste of money, brains and time - wombat(A2DA482A)]
Hi all,
1. Currently, if you have some numeric data and do a math evaluation, for
instance
60 + 220 = 280
If you do a new evaluation on that line, the result is
60 + 220 = 280 standard_in) 1: parse error
SUGGESTION to the math maintainer: Might you alter the code to delete the
contents of the line or selection subsequent to an "=" character, before
evaluating?
2. The currency math commands, would it make sense to use the detected
prefix?
i.e., currently "$20 + $40" evaluates to "$20 + $40 = 60"
Perhaps it should evaluate to "$20 + $40 = $60"
Cheers,
Tim
____________________
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.
-- G. Marx
^> works properly and gives me <%= %> but when I press the sequence
again to remove the '=', I get "/tmp/temp_textmate.tG33ud:4:in" Is
this a known problem?
Sorry if this is a repost.
---Brian Yamabe
Ahoy textmaties-
Over the past few weeks,, I'll be working in text-mate when all of
the sudden it loses it's ability to access the system cut and paster
buffer. It will only cut and paste internally. At the same time, the
"Find in a single" page functionality fails too, although I can still
perform global searches ( and sometimes "in selection" searches.) Any
one had these problems?
Version 1.5.4 (1349)
Thanks!
Hello. I was looking for some help from some RE experts.
We have a lot (as in hundreds of files) of javascript code that uses
the following declaration format:
function
MyJScriptFunction()
{
}
Because the "function" keyword and the function name are not on the
same line, the Javascript parser cannot populate the function list
with functions declared like this.
Is there a way to tweak the Javascript bundle so that it recognizes
functions declared as described above?
----------------------------
B.C.
Hello,
I've been using the blogging bundle for the past month with no
problems. However, yesterday I came back to university and am now
inside the network, with all sorts of restrictions. When trying to do
any of the commands such as posting to a blog, getting the category,
or looking the current word up in google and linking (my personal
favourite) I get the following error:-
/usr/lib/ruby/1.8/timeout.rb:42:in `new': execution expired (Timeout::Error)
from /usr/lib/ruby/1.8/net/protocol.rb:83:in `connect'
from /usr/lib/ruby/1.8/net/protocol.rb:82:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:55:in `timeout'
from /usr/lib/ruby/1.8/net/protocol.rb:82:in `connect'
from /usr/lib/ruby/1.8/net/protocol.rb:64:in `initialize'
from /usr/lib/ruby/1.8/net/http.rb:430:in `open'
from /usr/lib/ruby/1.8/net/http.rb:430:in `do_start'
from /usr/lib/ruby/1.8/net/http.rb:419:in `start'
... 9 levels...
from /Users/Joanna/Library/Application
Support/TextMate/Support/lib/progress.rb:41:in `call_with_progress'
from /Users/Joanna/Library/Application
Support/TextMate/Support/lib/progress.rb:38:in `dialog'
from /Users/Joanna/Library/Application
Support/TextMate/Support/lib/progress.rb:38:in `call_with_progress'
from /tmp/temp_textmate.IbaTBN:45
I was wondering if anything could be done about it, if I needed to
change some preferences or something.
Thanks, Joanna