Last active
May 24, 2019 21:09
-
-
Save dedeibel/471526594cdb7f53cbfb354ba22d3ab5 to your computer and use it in GitHub Desktop.
fish shell function to emulate zsh's push-line feature := store the current command and run one in between - restore the last command afterwards
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
# Save this file to ~/.config/fish/functions/push-line.fish | |
# Bind the function by using this in ~/.config/fish/functions/fish_user_key_bindings.fish | |
# function fish_user_key_bindings | |
# # For example alt+q | |
# bind \eq push-line | |
# end | |
function push-line | |
commandline -f kill-whole-line | |
function restore_line -e fish_postexec | |
commandline -f yank | |
functions -e restore_line | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment