Hacker News new | past | comments | ask | show | jobs | submit login

Can anyone tell me if there is a substitute for history expansions such as "sudo !!" or "vi !$" ?

This is the best answer I found to this question:

> http://fishshell.com/docs/current/faq.html#faq-history

> Alt+Up recalls individual arguments, starting from the last argument in the last line executed. ...

I was really missing history substitution in fish, but now I like this even better.

No. But you can always go back to previous command with up arrow key and modify it.

  function sudo!!
      eval sudo $history[1]
is pretty close.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact