1. Re: Fwd: High CPU Usage in snow leopard (Brandon M Fryslie)
I had exactly the same problem. And finally I've found a workaround.
In my case, I also use sshfs, and I've been looking at the unix "top" application to see which process was eating my computer, until I realised that the problem was caused in the combination of sshfs mounted filesystem and textmate (most times, meanwhile I was looking for something in a big project with textmate).
The process that was eating all cpu was mdworker / mds (spotlight daemon)
So I tried to disable spotlight completely and the problem didnt happen again. When I turned on spotlight... I was able to work for a whlie... and then the beachball appeared again, so what I've done is to add the folder where I mount the sshfs filesystem to Privacy Tab, to prevent Spotlight from indexing the content of the sshfs mounted filesystem.
And no more issues. In my case I'm using virtualbox with a headless ubuntu server 8.04
Hope this helps
Miquel
On 15/07/2011, at 14:00, textmate-request(a)lists.macromates.com wrote:
>
> 1. Re: Fwd: High CPU Usage in snow leopard (Brandon M Fryslie)
There is a plugin called ReMate which should fix the problem. If you are
editing files over a network share, this is bad news with TextMate and will
probably eventually crash and lose your work. Be careful.
http://ciaranwal.sh/remate/
> 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
> ?
>
> 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