Discussion:
using shell variables with ctrl+y
Daliyot, Maoz
2009-09-30 10:51:45 UTC
Permalink
Hi,
I wonder if there is a way to load nedit with some shell variables definitions, such that "ctrl+y" would open a pointer which includes shell variable in its path.

For example, let's say I have $PROJ_TOOL variable defined in shell, and I want to open a file in nedit with ctrl+y, that is pointed for example like:

$PROJ_TOOL/dir/file.txt

Thanks!

Maoz


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Offer Kaye
2009-10-01 09:26:53 UTC
Permalink
Post by Daliyot, Maoz
Hi,
I wonder if there is a way to load nedit with some shell variables definitions, such that "ctrl+y" would open a pointer which includes shell variable in its path.
$PROJ_TOOL/dir/file.txt
Thanks!
Maoz
You can create a simple macro with the contents:
open(shell_command( "echo -n " get_selection() , "" ))

Bind the macro to the keybinding of your choice and you're all set.
For simple cases this should work well.

Regards,
--
Offer Kaye
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Aldric L'Hernault
2009-10-01 11:04:09 UTC
Permalink
Post by Offer Kaye
open(shell_command( "echo -n " get_selection() , "" ))
Great ! I've just tested it and I suggest to use get_selection("any").
It allows using selection from anywhere, either into nedit or outside
(terminal, etc...) as regular "open selected" does.

Regards,
Aldric L'Hernault
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Daliyot, Maoz
2009-10-12 12:59:02 UTC
Permalink
Thanks Kaye and Hernault!
I was on vacation and just now got to implement your suggestions.
It works just fine.
Many thanks!

Maoz

-----Original Message-----
From: discuss-bounces-***@public.gmane.org [mailto:discuss-bounces-***@public.gmane.org] On Behalf Of Aldric L'Hernault
Sent: Thursday, October 01, 2009 1:04 PM
To: General NEdit discussion list
Subject: Re: using shell variables with ctrl+y
Post by Offer Kaye
open(shell_command( "echo -n " get_selection() , "" ))
Great ! I've just tested it and I suggest to use get_selection("any").
It allows using selection from anywhere, either into nedit or outside
(terminal, etc...) as regular "open selected" does.

Regards,
Aldric L'Hernault
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Continue reading on narkive:
Loading...