Re: [Fish-users] patch: Enable editing of command with $EDITOR

2015-04-15 Thread Mandeep Sandhu
I think it'll be best if you send the patch via github, where others can review and give comments easily. I'm not a reviewer, but the last time I sent commits (more than a yr ago), it was via github. Easy to track changes there (maybe you can open a feature request for it there). On Wed, Apr 15,

[Fish-users] patch: Enable editing of command with $EDITOR

2015-04-15 Thread Greg Reagle
This is my first time trying to contribute to fish, so please forgive any mistakes I make. The patch is included as an attachment and Sanne Wouda wrote this function which I changed a little. >From 64af63b71f2bbf168a6e833390e72b5e04d27b66 Mon Sep 17 00:00:00 2001 From: Greg Reagle Date: Wed, 1

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Sanne Wouda
Yeah, I'm on the nightlies :) On Wed, 15 Apr 2015 19:06 Greg Reagle wrote: > On 04/15/2015 11:45 AM, Sanne Wouda wrote: > > Greg, unfortunately, you cannot rewrite it like that. You have to > > put quotes around (cat $tmp), or each token will end up on its own > > line in the command buffer. >

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Greg Reagle
On 04/15/2015 11:45 AM, Sanne Wouda wrote: > Greg, unfortunately, you cannot rewrite it like that. You have to > put quotes around (cat $tmp), or each token will end up on its own > line in the command buffer. I understand what you mean now, but this problem does not happen for me. Maybe the be

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Greg Reagle
On 04/15/2015 11:45 AM, Sanne Wouda wrote: > Greg, unfortunately, you cannot rewrite it like that. You have to > put quotes around (cat $tmp), or each token will end up on its own > line in the command buffer. (And in fish, you cannot do command > substitution inside quotes.) I don't understand.

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Sanne Wouda
Greg, unfortunately, you cannot rewrite it like that. You have to put quotes around (cat $tmp), or each token will end up on its own line in the command buffer. (And in fish, you cannot do command substitution inside quotes.) Something like [...] commandline -r "" cat $tmp | while read -l cmd; c

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Greg Reagle
On 04/15/2015 11:09 AM, Sanne Wouda wrote: > It is possible to implement this with a fish function. > > function edit_commandline > set -l tmp (mktemp /tmp/fish-fc.XX) > commandline > $tmp > eval $EDITOR $tmp > cat $tmp | read -l cmd > commandline -r "$cmd" > rm $tmp > end > > Of

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Sanne Wouda
It is possible to implement this with a fish function. function edit_commandline set -l tmp (mktemp /tmp/fish-fc.XX) commandline > $tmp eval $EDITOR $tmp cat $tmp | read -l cmd commandline -r "$cmd" rm $tmp end Of course, if you do this properly, you'd have to check whether mktemp

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Wai Yan Pong
Yes, I missed that feature too. Hopefully developers of fish will consider adding that. That seems more adhere to the linux philiosophy---better leave it to the editor instead of the shell to do the editing. On Tue, Apr 7, 2015 at 12:38 AM, Gareth Skinner wrote: > Hi fish-users, > > In bash, you

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread SanskritFritz
On Tue, Apr 7, 2015 at 9:38 AM, Gareth Skinner wrote: > Hi fish-users, > > In bash, you can hit Ctrl-x-e to open your current command line in > $EDITOR, make your modifications, and the shell runs your command when you > exit. It also exists in zsh: > http://stackoverflow.com/questions/890620/una

Re: [Fish-users] Edit command line in $EDITOR?

2015-04-15 Thread Greg Reagle
On 04/07/2015 03:38 AM, Gareth Skinner wrote: > In bash, you can hit Ctrl-x-e to open your current command line in > $EDITOR, make your modifications, and the shell runs your command > when you exit. Thanks for pointing that out; I had no idea, even though I used bash for many years before switch