7 ms·
Avid fish user since last 3 years. On feature I miss from bash is the `sudo !` to re-run previous command as sudo. Last time I checked fish didn't offer an equi
by tapsboy 9y ago
Avid fish user since last 3 years. On feature I miss from bash is the `sudo !` to re-run previous command as sudo. Last time I checked fish didn't offer an equivalent. Either that or something similar will be useful
- V-eHGsd_ 9y ago!! and !$ are the two miss most. but similarly, fish user for the last 2+ years.
- erk__ 9y agoWith !$ you can use Alt+. to write the arguments from the last command.
- cben 9y agoAlt+. is a bash (libreadline really) key. In fish Alt+Up does something similar, but repeated presses iterates over all words of all commands rather than last words of bash commands. A big improvement is you can type some chars first and then Alt+Up only gets words matching this substring — like Up but word granularity! (Closest bash key is Ctrl+Alt+I) If you don't mind the differences, and want Alt+. muscle memory to work in fish too, do: bind \e. history-token-search-backward (plus Alt+Up doesn't work for me in linux console, Alt+. does)
- sry_not4sale 9y agoI missed it too, so I created a fish function: ``` function sudo if test "$argv" = !! eval command sudo $history[1] else command sudo $argv end end ``` This works for `sudo !!` https://github.com/srynot4sale/dotfiles/blob/master/fish/functions/sudo.fish https://github.com/srynot4sale/dotfiles/blob/master/fish/fun...
- mixmastamyk 9y agoI use up, ctrl-a, then type "sudo ".
- dalbotex 9y agoThis is easily achieved using a fish function: https://github.com/nyarly/fish-bang-bang https://github.com/nyarly/fish-bang-bang Unlike bash, fish even expands it in place, allowing you to make changes.
- sli 9y agozsh also expands in place for double bang, as well as the ^match^replace thing, too. Probably others, but those are the only ones I use regularly.
- jhasse 9y agoUp, Home, "sudo " Only one more key press than "sudo !" :)