>
> Any way around this?
Thanks
Make sure your macro is 'move backward one word' (option+arrow) and not
'move to beginning of line' (command+arrow). If the macro looks fine, there
might be some sort of interaction between the snippet tab stops and the
macro system but unfortunately I have only played around with making my own
macros and rarely use them for actual work.
Protip: the macro is stored in a plist file somewhere, and you can edit it
by hand to make it do exactly what you want.
Brandon
>
> I think Brandon is being a little melodramatic with with 'probably
> eventually crash?'.
It's only melodramatic until it happens and you DO lose some work. It has
happened to me. However, I was using MacFusion which mounts the network
share like a local FS, causing TextMate to crash pretty much right
away...Now I use ForkLift which is the most fantastically awesome remote
file management tool I've ever had the pleasure of using. Not only do I
recommend using it, I recommend *paying* for it. Yep, that good. :)
Brandon
Hmmm,
That does not seem to work. Do I create a preference file in my custom bundle
because that did't work. I found the preference file that you mentioned in
various bundles, in Source and added the ( '<', '>' ) but again it doesn't
autocomplete
What am I missing?
Thanks
--------------
Sure. In the bundle editor, look for a Preference, probably called "Smart
Typing Pairs" or something similar. It might look like this: {
smartTypingPairs = ( ( '"', '"' ), ( '(', ')' ), ( '{', '}' ), ( '[', ']' ), (
'“', '”' ), ( "'", "'" ), ); } Basically, it's just a series of pairs. You can
add ( "<", ">"), to the list and that should do it. On Jul 13, 2011, at 10:19
AM, John Relosa wrote: That works great thanks! Is there a way to
autocomplete the < symbol? I can do it with the { so when I press "{" TM
autocompletes it with the end } so it automatically becomes {}. How can I add
that functionality to the "<" symbol so it automatically becomes <>. Thank you.
___________________________________________
Hi,
When i open a folder on textmate, in this case, kohana stack. I open e
file writing some code. Then save it, goto chromium to check. Now when
return to textmate, textmate freezes and takes 100% CPU, after some
time, 5 to 20second, everything comes to normal. This happenes every
time textmate lost focus then got focus again.
step to reproduce,
1. Open textmate and open a file.
2. Goto another app while keeping textmate open, In a word,make
textmate lose focus.
3. Return to textmate, In a word, make textmate got focus.
=> Cpu usage goto 100% and textmate hangs.
I'm suspecting that when getting focus, textmate scans the files for
changes outside textmate, is that it ? if so, is there any workaround
?
Sarim Khan
Hello,
Thanks for your reply. This works for stand alone typed variables but on
snippets where I have let's say a "while loop" with
a certain condition as a place holder:
while (condition) ... end while
after I type my shortcut and press the tab, the snippet completes and takes the
caret into the (condition) variable where If I type the name that I want and
press my shortcut for the macro to add the "$" symbol then TM adds it infront of
"while" so
it becomes:
$while (condition) ... end while
instead of:
while ($condition) ... end while
Any way around this?
Thanks
You can do this by recording a macro. Type a word, then under Bundles on the
toolbar, go to Macros and click Start Recording. Press the key combination for
'move to beginning of word' (which is option+left arrow for me), and then press
'$'. Then click 'Stop Recording'. With any luck you should have a macro that
does 'move to beginning of word' and then 'insert $'. You can do that for all
the characters you need, and obviously much more complicated scenarios. Brandon
> Hello, > I was wondering if that is possible. The symbol for variable in the >
language I > am working on is the "$" sign. > Would it be possible to add this
after the word has been typed and have it > added > in the beginning of the
word? The same would go for the array symbol %, > strings array "!" etc.. > So I
would type "counter" and then decide if I want this to be a variable > or an >
array so depending if I type $ or % after that word it would end up being >
$counter or %counter > Thanks in advance for any input. > Best, > John
That works great thanks!
Is there a way to autocomplete the < symbol? I can do it with the { so when I
press "{" TM autocompletes it with the end } so it automatically becomes {}. How
can I add that functionality to the "<" symbol so it automatically becomes <>.
Thank you.
___________________________________________
You could easily customize the folding patterns. It would be up to you to
decide what your convention would be; just add those angle brackets in to the
pattern and you should be on your way.
You can also easily add more folding patterns. If I'm understanding your
request right, you could simply match on "function" and "end function", etc, you
just need to map them all out. So, combined, something like this:
foldingStartMarker = '\{<[^\/]+>\}|^(loop|function|if|on init)';
foldingStopMarker = '\{<\/.+>\}|^(end (loop|function|if|on))'; If you want to
add more folding matches following the "X/end X" pattern, just add a pipe and
the "X" to the parts in both expressions that look like this:
(loop|function|if|on init) Hope that helps, +dru On Jul 13, 2011, at 8:23 AM,
John Relosa wrote: Hello, thanks, this works ok but now every time I have any
{comment}, TM shows a down fold arrow only (since there is no {/comment}
obviously. Is there a way to have the {block}...code...{/block} folding system
differentiate from regular {comments} It could be something like: {<block>}
{comment on code} code {comment on loop} {<loop>} loop code end {</loop} more
code {</block>} Only the {<...>} ...... {</...>} would have folding markers and
not the regular {comment}. Secondly regarding the language, there is no
standard folding set but it would be nice to set up keywords that would start
and end folds in user defined paired words like function.... end function,
if...end if, on init...end on, etc... Is that possible? Thanks in advance.
You can do this by recording a macro. Type a word, then under Bundles on
the toolbar, go to Macros and click Start Recording. Press the key
combination for 'move to beginning of word' (which is option+left arrow for
me), and then press '$'. Then click 'Stop Recording'. With any luck you
should have a macro that does 'move to beginning of word' and then 'insert
$'. You can do that for all the characters you need, and obviously much
more complicated scenarios.
Brandon
> Hello,
> I was wondering if that is possible. The symbol for variable in the
> language I
> am working on is the "$" sign.
> Would it be possible to add this after the word has been typed and have it
> added
> in the beginning of the word? The same would go for the array symbol %,
> strings array "!" etc..
> So I would type "counter" and then decide if I want this to be a variable
> or an
> array so depending if I type $ or % after that word it would end up being
> $counter or %counter
> Thanks in advance for any input.
> Best,
> John
Hello,
I was wondering if that is possible. The symbol for variable in the language I
am working on is the "$" sign.
Would it be possible to add this after the word has been typed and have it added
in the beginning of the word? The same would go for the array symbol %,
strings array "!" etc..
So I would type "counter" and then decide if I want this to be a variable or an
array so depending if I type $ or % after that word it would end up being
$counter or %counter
Thanks in advance for any input.
Best,
John
Hello,
thanks, this works ok but now every time I have any {comment}, TM shows a down
fold arrow only (since there is no {/comment} obviously.
Is there a way to have the {block}...code...{/block} folding system
differentiate from regular {comments}
It could be something like:
{<block>}
{comment on code}
code
{comment on loop}
{<loop>}
loop
code
end
{</loop}
more code
{</block>}
Only the {<...>} ...... {</...>} would have folding markers and not the regular
{comment}.
Secondly regarding the language, there is no standard folding set but it would
be nice to set up keywords that would start and end folds in user defined paired
words like
function.... end function, if...end if, on init...end on, etc... Is that
possible?
Thanks in advance.
------------------------------
Message: 4
Date: Tue, 12 Jul 2011 13:01:25 -0700
From: Dru Kepple <dru(a)summitprojects.com>
To: TextMate users <textmate(a)lists.macromates.com>
Subject: [TxMt] Re: Custom Folding
Message-ID: <882B4362-5E89-413C-AA0A-BA1FD64670DB(a)summitprojects.com>
Content-Type: text/plain; charset="us-ascii"
A basic folding pattern could be set up like this:
foldingStartMarker = '\{([^\/]+)\}';
foldingStopMarker = '\{\/.+\}';
This won't be smart enough to match the text in between the curly braces, but as
long as you use the slash to mark an end comment, it should be pretty workable.
TextMate will handle nesting as you'd probably expect it to, so this:
{block}
code
{loop}
loop
code
end
{/loop}
more code
{/block}
Should fold as you'd want it to.
Do you have standard folding set up for the language? I don't know what
language you're using, but folding is usually set up for things like functions
and loops, so that's helpful, too. But I mention it because if you have to add
the above markers into an existing language grammar that already has markers set
up, you'll need to do them like this:
foldingStartMarker = 'otherMarker|\{([^\/]+)\}';
Note the vertical pipe in between the new addition and the existing marker;
that's the regex "or".
Also, worth noting that TextMate only matches folds if the start and stop
markers are at the same indent level, not merely if the marker is matched. You
might get some interesting folding results with the additions combined with
goofy indentation.
+dru
On Jul 12, 2011, at 11:12 AM, John Relosa wrote:
Hello,
Excuse my newbie question but I am trying to do custom folding in the language
that I am working on and can't figure out how.
Comments in this language start and end with { comment..... } Anything else is
compilable.
Is there a way to specify something like
{Start of code block}
code
.
.
.
.
{/End of code block}
Thanks
John
_______________________________________________
textmate mailing list
textmate(a)lists.macromates.com<mailto:textmate@lists.macromates.com>
http://lists.macromates.com/listinfo/textmate
-