Skip to content

Instantly share code, notes, and snippets.

@hsbt
Created April 20, 2017 09:38
Show Gist options
  • Save hsbt/b10b3e856d5ca6ef6737504030f47557 to your computer and use it in GitHub Desktop.
Save hsbt/b10b3e856d5ca6ef6737504030f47557 to your computer and use it in GitHub Desktop.
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