ed basically works like what you can do in vim's normal mode (other than not having to prefix the commands with a :). IIRC, Bill Joy wrote ex as an improved version of ed and he subsequently added a visual mode to ex called vi. You can enter ex mode in vim using Q (though it may be bound to gQ) and you can exit it by typing vi.