News for hackers. Stuff that matters.
Re:Fish 2.0 shell beta by kbd on Wednesday April 17, 2013 @10:02PM (#5568547)
Re:Fish 2.0 shell beta by pooriaazimi on Wednesday April 17, 2013 @11:06PM (#5568716)
Wonderful!

I made a slight variation (and also posted it there):

      function .runsudo --description 'Run current command line as root'
        set cursor_pos (echo (commandline -C) + 5 | bc)
        commandline -C 0
        commandline -i 'sudo '
        commandline -C "$cursor_pos"
      end
      bind \es ".runsudo"
Instead of outright `execute`ing the command, the above would save the cursor position. You can (theoretically) bind `\cs` so control-s adds the sudo (instead of option-s), but I couldn't get it to work.