Created
April 20, 2017 09:38
-
-
Save hsbt/b10b3e856d5ca6ef6737504030f47557 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
require 'yaml' | |
r = {} | |
File.open('dot.zsh-history') do |f| | |
r = f.each_line.inject([]) do |a, l| | |
a << { "cmd" => l[15..-1].to_s.scrub.strip, "when" => l[1..11].to_i } | |
end | |
end | |
File.open('fish_history', 'w'){|f| f.write r.to_yaml(options = { line_width: -1 })} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment