Move all Esc key and input mode related logic into vim.coffee