Created
March 11, 2020 21:39
-
-
Save LukeWood/5109cb6dddc65fb88c3c7545831e3a12 to your computer and use it in GitHub Desktop.
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
# Copies the most recent history matching a given query to the X11 clipboard provided | |
# Example | |
# > hcopy run | |
# > # ctrl-V | |
# > ./run.sh --some-arg | |
# Requires X11 Forwarding in SSH | |
# https://www.unixtutorial.org/get-x11-forwarding-in-macos-high-sierra | |
function hcopy | |
history search $argv[1] --max=1 --reverse | xclip -selection clipboard | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment