Re: Symlink to textadept on OS X

From: vais <vsalik....at.gmail.com>
Date: Sat, 7 Feb 2009 10:03:31 -0800 (PST)

Rob, thank you for helping out a Mac newb :)

This totally works, and you can actually pass the -n option to the
alias instead of hard-coding it into the alias command. So, ta -n
file.txt will open file.txt in a new textadept instance. I am not sure
this is a good idea, though, cause you will have multiple instances of
textadept writing to the same .ta_session file (last one wins, which
may or may not be what you want or expect to happen).

One more tip for anyone following this: you need to put the alias
creation command into the .bash_profile file in your home directory.
If you just execute it from the command line it will work, but only
for the duration of that terminal session. Here is what's in my "/
Users/vais/Desktop/.bash_profile":

alias ta='open -a /Applications/textadept.app'

So:
"ta" opens textadept and loads your last saved session.
"ta file.txt" opens file.txt as a new buffer in the already open
textadept instance (of course, it opens textadept if not already open,
loads the session, then opens file.txt as a new buffer).
"ta -n" works like the above, but opens a whole new instance of the
application.

Once again, thank you, Rob!

Vais

On Feb 7, 4:54 am, Rob <ro....at.web.de> wrote:
> You can set up an alias using the open command:
> alias textadept='open -a ~/Applications/textadept.app'
> Then, 'textadept example.txt' should open the file in Textadept.
>
> On a side note, that either opening executable inside the .app bundle
> or more simply
> open -n -a ~/Applications/textadept.app
> will open another instance of Textadept. I think this was asked
> recently.
>
> Btw, thanks Mitchell for this really promising editor. I used Scite
> when I used Windows,
> but never really got into it, because I want my editor to be cross-
> platform.
>
> Best,
> Rob
>
> On Feb 6, 10:37 pm, vais <vsalik....at.gmail.com> wrote:
>
> > Textmate has a "mate" tool for working with the Textmate app from the
> > shell. How do you use Textadept from the shell on OS X?
>
> > The way I have been doing it is by invoking textadept executable
> > inside the .app. This is a pain, since you have to either cd into
> > the .app/Contents/etc... or use the same full path to the executable
> > every time.
>
> > I have tried creating a symlink to the textadept file inside the .app
> > ("ln -s path_to_exec_inside_app ."), but that does not work because
> > the _HOME variable in Lua gets set to the current directory instead of
> > being inside of the .app directory, so it cannot find any files it
> > requires, and textadept fails to start with an error message to that
> > effect.
>
> > Am I missing something? How does it work on Linux then, since the
> > installation instructions are to use a symlink? Does the _HOME
> > variable initialization work differently? Bottom line, is there
> > anybody using TA from the command line on OS X out there?
>
Received on Sat 07 Feb 2009 - 13:03:31 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:12 EST