{"action":"created","issue":{"url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/52","labels_url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/52/comments","events_url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/52/events","html_url":"https://github.com/t9md/atom-vim-mode-plus/issues/52","id":121379926,"number":52,"title":"providing common command to compliment ex-mode.","user":{"login":"t9md","id":155205,"avatar_url":"https://avatars.githubusercontent.com/u/155205?v=3","gravatar_id":"","url":"https://api.github.com/users/t9md","html_url":"https://github.com/t9md","followers_url":"https://api.github.com/users/t9md/followers","following_url":"https://api.github.com/users/t9md/following{/other_user}","gists_url":"https://api.github.com/users/t9md/gists{/gist_id}","starred_url":"https://api.github.com/users/t9md/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t9md/subscriptions","organizations_url":"https://api.github.com/users/t9md/orgs","repos_url":"https://api.github.com/users/t9md/repos","events_url":"https://api.github.com/users/t9md/events{/privacy}","received_events_url":"https://api.github.com/users/t9md/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/labels/atom-is-not-vim","name":"atom-is-not-vim","color":"009800"},{"url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-10T01:19:15Z","updated_at":"2015-12-10T03:32:45Z","closed_at":null,"body":"Many of former vim-mode user seem to use ex-mode.\r\nBut I'm not motivated to use different command prompt in one editor(Atom already have native command-palette feature as explained in #32).\r\n\r\nInstead of providing indipendent command-mode( ex-mode ) to minic pure Vim.\r\nI want to gather information from ex-mode user about what operation you are using frequently via ex-mode.\r\n\r\nBased on that information I can make those command via command-palette.\r\nFor example I locally using custom user command  which toggle line-wrap.\r\nI can include it as xxxxx to be able to toggle wrap from command-palette.\r\nWhat other commands you guys make it available as command, put this discussion."},"comment":{"url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/comments/163476866","html_url":"https://github.com/t9md/atom-vim-mode-plus/issues/52#issuecomment-163476866","issue_url":"https://api.github.com/repos/t9md/atom-vim-mode-plus/issues/52","id":163476866,"user":{"login":"t9md","id":155205,"avatar_url":"https://avatars.githubusercontent.com/u/155205?v=3","gravatar_id":"","url":"https://api.github.com/users/t9md","html_url":"https://github.com/t9md","followers_url":"https://api.github.com/users/t9md/followers","following_url":"https://api.github.com/users/t9md/following{/other_user}","gists_url":"https://api.github.com/users/t9md/gists{/gist_id}","starred_url":"https://api.github.com/users/t9md/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t9md/subscriptions","organizations_url":"https://api.github.com/users/t9md/orgs","repos_url":"https://api.github.com/users/t9md/repos","events_url":"https://api.github.com/users/t9md/events{/privacy}","received_events_url":"https://api.github.com/users/t9md/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T03:32:45Z","updated_at":"2015-12-10T03:32:45Z","body":"here is the prototype for ex-mode complement feature which user copy&paste to `init.coffee`\r\nAlthough, I noticed `wq` throw some error when linter is enabled which is not actually this code's problem.\r\nThe evaluation result was good, but a bit slow(inserting text to command-palette fire narrowing process), maybe I can provide independent select-list view for this particular purpose.\r\n\r\n```coffeescript\r\ndispatch = (commands...) ->\r\n  editor = atom.workspace.getActiveTextEditor()\r\n  editorElement = atom.views.getView(editor)\r\n  for command in commands\r\n    atom.commands.dispatch(editorElement, command)\r\n\r\ngetCommandPaletteView = () ->\r\n  for {item} in atom.workspace.getModalPanels()\r\n    return item if item.constructor.name is 'CommandPaletteView'\r\n\r\ngetCommandPaletteEditor = () ->\r\n  getCommandPaletteView().filterEditorView.getModel()\r\n\r\ninsertToCommandPaletteEditor = (text) ->\r\n  editor = getCommandPaletteEditor()\r\n  editor.insertText(text)\r\n  editor.moveToEndOfLine()\r\n\r\natom.commands.add 'atom-workspace',\r\n  'ex-command:w': -> dispatch 'core:save'\r\n  'ex-command:wq': -> dispatch 'core:save', 'core:close'\r\n\r\nexCommandsPrefix = 'Ex Command:'\r\natom.commands.add 'atom-workspace',\r\n  'user-ex-command-open': ->\r\n    dispatch 'command-palette:toggle'\r\n    insertToCommandPaletteEditor(exCommandsPrefix)\r\n```"}}