Skip to content

Instantly share code, notes, and snippets.

@jstorimer
Created January 23, 2010 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstorimer/284623 to your computer and use it in GitHub Desktop.
Save jstorimer/284623 to your computer and use it in GitHub Desktop.
function --on-event fish_command_not_found method_missing
fish_method_missing $argv;
end
#!/usr/bin/env ruby
command = ARGV.shift
def run(cmd)
puts "Running #{cmd.inspect} instead"
system(cmd)
end
case command
when '!!'
fish_history = File.read("/Users/jesse/.config/fish/fish_history").split("\n")
previous_command = fish_history.last
run(previous_command)
else
$stderr.puts "No default action defined in #{__FILE__.inspect}"
abort
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment