I don't think this would be too difficult to write in vim, which has built-in auto-complete functions.