Skip to content

Instantly share code, notes, and snippets.

@hsbt

hsbt/zsh-to-fish.rb

Created Apr 20, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.