Last active
June 19, 2022 12:46
-
-
Save curipha/fa243aa3f1550d27cd89cc029aa30bfd to your computer and use it in GitHub Desktop.
History merge tool for zsh
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
#!/usr/bin/env ruby -E BINARY | |
# The original script was published in zsh thread@2ch.net and is licensed under the public domain. | |
history = [] | |
l = nil | |
while l = gets | |
while /\\\Z/ === l | |
l << gets | |
end | |
history << l | |
end | |
puts history.sort | |
#puts history.sort.uniq | |
# 'uniq' is not work well because history = [': 1332408755:0;ls', ': 1332408761:0;ps', ...] | |
# You shoud leave unifying history to zsh. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment