Hey guys, I use textmate a LOT on OS-X Leopard 1.5.6 as my main CLI
text editor via .bash_profile and I edit a lot of files from my
computer with textmate. But I have issues with permissions when
trying to "mate" files which my user does not have permissions to
read. Even if I "sudo mate". Textmate pretends it opened this file
but the file is empty, and when you save it it will ask for
administrative privileges to do so.
Steps to reproduce:
$ echo "this is a test" > testfile
$ sudo chown root testfile
$ sudo chmod 700 testfile
$ sudo mate testfile
Result:
Textmate opens a window called "testfile" but shows nothing in this
file. If you edit this file and hit save, a window pops up which asks
for your credentials to save over this file.
Expected result:
#1 - preferred: uses the above "sudo" permission to pass into and/or
launch textmate under for editing of this file. Which would allow
opening and saving of this file without requiring re-entry of
credentials (annoying).
#2 - secondary/temporary alternative: upon failing opening a file
(like what's happening here) asking the user for credentials which
would allow opening the file. If this fails, do not open the window
because clearly, you don't have permissions for this file anyway, you
shouldn't have an editor window open for it. If their credentials
succeed, use the "open" permission for saving also.
Anyone have a workaround for this, or any ideas? The contact area
said to post here first. I googled a bit and didn't find anything so
I'm starting here.
Cheers!
- Andrew
Hi,
call it good or bad, I'm using soft tabs (spaces) for just about
everything. The shop I work in doesn't even allow tabs in (most) source
files. Soft tabs in TextMate work great – except that I really need hard
tabs (just like everyone else) in Makefiles. So, what I currently keep
doing is to copy&paste a tab character from some other place. I'd really
love to tell TextMate to use hard tabs for everything in scope of the
Makefile bundle, without changing my global setting. Is that possible?
(If yes, why is it not active in the Makefile bundle?) Will it be
possible in 2.0?
Christopher
Hello,
As matlab code can't get compiled, I'm assuming you talk about running
matlab code from textmate.
I implemented an integration between MATLAB and Textmate, which allows
to run a script or the current cell in matlab when you are in
textmate. It only works when matlab runs in the terminal, as there is
NO WAY to communicate with the matlab java/X11 GUI.
Because the terminal is quite awful to use in interactive mode (no
mouse, different shortcuts, no syntax highlighting, problem with long
lines), I'm working on a matlab console bundle too, which works in a
similar way as the R-Console Bundle. I can communicate with matlab
both ways now. It's possible send commands to matlab and receive
matlab's output.
I sent an email to Thomas to discuss the integration of this in the
matlab bundle, but he seems busy now.
If you want more information about what I did, want to try, or better
if you want to help with this project (I'm quite bad at ruby, shell
scripts and other needed languages), send me an email.
Pierre
When editing comments in TextMate, I frequently use the Reformat
Selection text routine to fix paragraphs who's lines have gone past 80
characters long (my Wrap Column). Unfortunately this has some
unexpected side-effects in Java, which along with nicely reformatting
my selected comments (respecting the *s in the beginning of the line
even!) adds redundant starting and ending comments: /* and */. Why
does this happen? What can I do to fix this?
To reproduce, select a few lines inside a javadoc-formatted Java
comment (/** * */), and hit ^Q.
Thanks,
--
Elliot
Hello all, I'm trying to make use of some external refactoring tools
for Haskell, and I've written the following script:
#!/usr/local/bin/ runghc
import System.Cmd
where
main = do
c <- getContents
system ("/Users/ian/.cabal/bin/pointfree \"" ++ c ++ "\"")
Here's the problem:
Whenever I try to run the script, the output I get says "interpreter
failed: Permission denied". Now, I'm pretty sure that the script
execution fails even without executing the local program pointfree.
Any ideas what I'm doing wrong?
-Ian Duncan
Hello,
I have read this page
http://blog.macromates.com/2005/handling-encodings-utf-8/ and I use
UTF8 wherever I can. But, sometimes I have to open czech text-files,
made on MS Windows (not made by me), that are, almost without
exception, in "Central European (Windows Latin)", or, Windows 1250 (
http://en.wikipedia.org/wiki/Windows-1250 ).
ISO-8859-1 is different from Windows-1250, some of the czech letters
appear weird - for example, http://en.wikipedia.org/wiki/Ø instead of
http://en.wikipedia.org/wiki/Ř
Right now, when I get file like that, I need to
1) open it in TextMate, only to find out I cannot open it
2) open TextEdit, open the file in TextEdit, re-save it in UTF8
3) open it in TextMate again, swearing on all sides
I personally find this procedure stupid and I would love to have the
opportunity to, at least, open the file in Windows-1250 and convert it
to UTF8 and not having to start another text editor.
Karel Bilek
Hi,
I recently opened one of my old Java files and remembered I used some
snippet to create a method and automatically create a header comment
and javadoc comment like this:
/**
* doSteps
*
* calculate n steps each lasting 0.005s
*
* @param steps number of steps each of which accounts for
0.005s
*/
public void doSteps(int steps) {
//do smth...;
}
I can't find this anywhere anymore. Can anyone help me out here? The
snippet automatically jumped to the return type, then the function
name (also inserting it at the top in the comment), then to the @param
thingy to enter text and finally to the function itself to write some
code. At least that's how I think it went. Might be that I idealize a
bit from bad memory :P
Does someone know of a snippet like this? I already searched the web
but couldn't find something. (Yeah I also searched the Javadoc
bundle... but it isn't there :( )
Maybe I was just dreaming of this snippet :(
Thanks,
Thomas Krajacic
Hi,
I'm sure that question must have been asked over and over, but I
couldn't find any similar question, so please forgive my ignorance.
I'm just wondering if there's any simple shortcut to navigate between
blocks. Suppose I'm in the middle of a big block, I want to go to the
end of it, or to the beginning. What's I'm currently doing is either
an F1 to fold the block, if I want to go outside (right after or right
before), but which is not ideal since I don't always want to actually
make the block invisible, or I use the Cmd-Shift-T to open the go to
symbol panel, then type Enter if I want to go to the beginning of the
block, or Down then Enter if I want to go to the end of the block. But
that's too many strikes.
Is there any direct shortcut for what I want - or how can I define
one? What are your habits on that topic? (I particularly use that when
writing LaTeX documents.)
Thanks,
enas
I think I got misunderstood by JiHo : I want to avoid the matlab GUI
as much as possible. The matlab-console I developed is an
implementation of the matlab console IN textmate.
For what I described I use a very similar command as JiHo, except that
I tend to use the cell mode (which Thomas added in the last version of
the bundle). And in this cases because the commands that are sent to
the terminal can be long, I use an temporary m-file (called cellrunner
in the following code).
I've came up with a better applescript thought, which is more robust
when you have several terminal windows or tabs running :
osascript<<END
tell application "Terminal"
set termwin to id of windows
set nwin to count of termwin
repeat with i from 1 to nwin
set ntab to number of tab of window i
repeat with j from 1 to ntab
set pr to processes of tab j of window i
set npr to count of pr
set runsmatlab to false
repeat with k from 1 to npr
set runsmatlab to "MATLAB" = item k of pr
end repeat
if runsmatlab then
set selected of tab j of window i to true
do script with command "cellrunner" in tab j of window i
end if
end repeat
end repeat
end tell
tell application "MATLAB" to activate
END
Pierre
Hi,
So I use Find in Project to search code and find various sources when
I've pulled down say.. a set of Java classes for an app. Once I find
a file I can click the file in the list of found items and it'll load
in the main window. But what I'd like is to also show that file in
the Project Drawer (since it's hidden somewhere in the hierarchy of
files).
Is this possible?
--
David Orriss Jr.
My blog: http://www.codethought.com/blog