Skip to content

Instantly share code, notes, and snippets.

@cryptoquick
Created November 28, 2019 17:19
Show Gist options
  • Save cryptoquick/931d04db69df2cb8d018440c22d580d9 to your computer and use it in GitHub Desktop.
Save cryptoquick/931d04db69df2cb8d018440c22d580d9 to your computer and use it in GitHub Desktop.
bind enter key to repeat last command in fish shell
function bind_enter
set -l lastline $history[1]
set -l cmdline (commandline)
if test -z (string trim "$cmdline")
commandline -r $lastline
commandline -f execute
else
commandline -f execute
end
end
bind \r bind_enter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment