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.XXXXXX)
>   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 
> failed, or whether EDITOR is set and executable.
> 
> To bind this to, for example, Ctrl-x, do
> $ bind \cx edit_commandline

GREAT!  Fish developers, how about making this function a standard part of fish?

I think it could re re-written slightly more concisely:

function edit_commandline
  set -l tmp (mktemp /tmp/fish-fc.XXXXXX)
  commandline > $tmp
  eval $EDITOR $tmp
  commandline -r (cat $tmp)
  rm $tmp
end


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to