fixes #17 (GH): create vi_cmd_data in a separate function
fixes #52: leave caret in insert mode if switching back to Sublime Text from another application (thanks quarnster)