Hi Stig,

I also missed !! and !$ when I moved to fish. Someone on this list (can’t 
remember who, sorry) pointed me to this:

 
https://github.com/fish-shell/fish-shell/wiki/Bash-Style-History-Substitution-%28%21%21-and-%21%24%29

I’ve been using it ever since and it works beautifully (I haven’t tried the 
abbr-based version at the bottom, only the key-binding one).

—Diego


> On 19 May 2016, at 10:21, Stig Brautaset <s...@brautaset.org> wrote:
> 
> Hello!
> 
> I'm a recent migrant from zsh and overall I'm overall happy with fish,
> but I do sorely miss the !$ and !! constructs. As an example, I often
> type a command only to have it error because I forgot to precede it with
> sudo. In zsh I would normally just type "sudo !!" to execute the
> previous command again, properly prefixed with sudo.
> 
> I understand that !$ and !! are not super discoverable, and that this is
> an explicit design goal in fish. Does fish have an alternative mechanism
> for this case that I just haven't discovered yet because I'm not
> thinking outside my zsh-shaped box? All suggestions welcome.
> 
> Stig
> 
> 
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to