Created
November 28, 2019 17:19
-
-
Save cryptoquick/931d04db69df2cb8d018440c22d580d9 to your computer and use it in GitHub Desktop.
bind enter key to repeat last command in fish shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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