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

2015-04-17 Thread Sepp Tannhuber
Such a feature exists in oh-my-fish's budspencer theme: https://github.com/bpinto/oh-my-fish/tree/master/themes/budspencer#edit-commandline-with-your-favorite-editor -- BPM Camp - Free Virtual Workshop May 6th at 10am PDT/

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

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

2015-04-09 Thread Gareth Skinner
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/unable-to-have-bash-like-c-x-e-in-zsh I've been playing around with f