{"action":"created","issue":{"url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/27","labels_url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/27/comments","events_url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/27/events","html_url":"https://github.com/lambdalisue/jupyter-vim-binding/issues/27","id":120156610,"number":27,"title":"eliminate Jupyter's command mode ","user":{"login":"greenify","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/greenify","html_url":"https://github.com/greenify","followers_url":"https://api.github.com/users/greenify/followers","following_url":"https://api.github.com/users/greenify/following{/other_user}","gists_url":"https://api.github.com/users/greenify/gists{/gist_id}","starred_url":"https://api.github.com/users/greenify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenify/subscriptions","organizations_url":"https://api.github.com/users/greenify/orgs","repos_url":"https://api.github.com/users/greenify/repos","events_url":"https://api.github.com/users/greenify/events{/privacy}","received_events_url":"https://api.github.com/users/greenify/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-03T12:09:19Z","updated_at":"2015-12-04T10:28:45Z","closed_at":null,"body":"tl;dr: There is only the `j` and `k` feature that we would loose by eliminating Jupyter's command mode.\r\n\r\nFor me it just feels wrong that we have three different modes: (1) Jupyter command's mode, (2) CodeMirror's/Vim' command mode and (3) CodeMirror's/Vim' edit mode (let's leave the visual mode out).\r\n\r\nIn my humble opinion we don't need Jupyter's command mode and could stay in CodeMirror's command mode the entire time - I have looked at all existing command mode mappings and here is my opinion/result:\r\n\r\nShould work fine\r\n---------------------\r\n\r\n```\r\n    \t'ctrl-c': 'jupyter-notebook:interrupt-kernel',\r\n    \t'ctrl-j': 'jupyter-notebook:select-next-cell',\r\n    \t'ctrl-k': 'jupyter-notebook:select-previous-cell',\r\n    \t'shift-j': 'jupyter-notebook:extend-marked-cells-below',\r\n    \t'shift-k': 'jupyter-notebook:extend-marked-cells-above',\r\n    \t'shift-m': 'jupyter-notebook:merge-cells',\r\n    \t'ctrl-1': 'jupyter-notebook:change-cell-to-code',\r\n    \t'ctrl-2': 'jupyter-notebook:change-cell-to-markdown',\r\n    \t'ctrl-3': 'jupyter-notebook:change-cell-to-raw',\r\n    \t'shift-h': 'jupyter-notebook:show-keyboard-shortcuts',\r\n    \t'shift-l': 'jupyter-notebook:toggle-cell-line-numbers',\r\n    \t'shift-v': 'jupyter-notebook:toggle-cell-output-collapsed',\r\n    \t'shift-s': 'jupyter-notebook:toggle-cell-output-scrolled',\r\n    \t'ctrl-s': 'jupyter-notebook:save-notebook',\r\n    \t'shift-g': 'vim-binding:select-last-cell',\r\n    \t'ctrl-u': 'jupyter-notebook:scroll-notebook-up',\r\n    \t'ctrl-d': 'jupyter-notebook:scroll-notebook-down',\r\n    \t'alt-enter': 'jupyter-notebook:run-cell-and-insert-below',\r\n    \t'ctrl-enter': 'jupyter-notebook:run-cell',\r\n    \t'shift-enter': 'jupyter-notebook:run-cell-and-select-next',\r\n    \t'z,z': 'jupyter-notebook:scroll-cell-center',\r\n    \t'z,t': 'jupyter-notebook:scroll-cell-top',\r\n    \t'0,0': 'jupyter-notebook:confirm-restart-kernel',\r\n```\r\n\r\nEasily resolved\r\n-------------------\r\n\r\n```\r\n    \t'shift-o': 'jupyter-notebook:insert-cell-above',\r\n    \t'o': 'jupyter-notebook:insert-cell-below',\r\n```\r\n-> only use `shift-o`\r\n\r\n```\r\n    \t'enter': 'jupyter-notebook:enter-edit-mode',\r\n    \t'i': 'jupyter-notebook:enter-edit-mode',\r\n```\r\n\r\nEdit mode would only be vim's edit mode.\r\n\r\n```\r\n        'esc': 'jupyter-notebook:close-pager',\r\n    \t'q': 'jupyter-notebook:close-pager',\r\n```\r\n\r\nThis would just leave vim's insert mode.\r\n\r\n```\r\n    \t'y,y': 'jupyter-notebook:copy-cell',\r\n    \t'd,d': 'jupyter-notebook:cut-cell',\r\n    \t'shift-p': 'jupyter-notebook:paste-cell-above',\r\n    \t'p': 'jupyter-notebook:paste-cell-below',\r\n```\r\n\r\nI propose `shift-y`, `shift-d`, `shift-p` and `ctrl-shift-p`. This could also be different, but should be consistent with the other commands, so that `shift-letter` is always below and `ctrl-shift-letter` is above (or `ctrl-letter` is below) - anyways I hope my point is clear ;-) \r\n\r\n```\r\n    \t'g,g': 'vim-binding:select-first-cell',\r\n    \t'u': 'jupyter-notebook:undo-cell-deletion',\r\n```\r\n\r\nI propose `shift-g` and `shift-u`.\r\n\r\n```\r\n    \t'1': 'jupyter-notebook:change-cell-to-heading-1',\r\n    \t'2': 'jupyter-notebook:change-cell-to-heading-2',\r\n    \t'3': 'jupyter-notebook:change-cell-to-heading-3',\r\n    \t'4': 'jupyter-notebook:change-cell-to-heading-4',\r\n    \t'5': 'jupyter-notebook:change-cell-to-heading-5',\r\n    \t'6': 'jupyter-notebook:change-cell-to-heading-6',\r\n ```\r\n\r\nI am not sure how useful those commands really are, so how about `ctrl-h,1`, `ctrl-h,2` ... ?\r\n(`ctrl-h` is usually mapped to the history in browsers, but I would safely assume that one doesn't need to access it during vim mode)\r\n\r\nSome work/action required\r\n---------------------------------\r\n\r\n```\r\n    \t'j': 'vim-binding:scroll-down',\r\n    \t'k': 'vim-binding:scroll-up',\r\n````\r\n\r\nI would imagine to patch those commands so once `j` hits the last line of a cell, it will automatically jump to the first line of the next - et vice versa for `k`.\r\nI will open a separate issue for that ;-)"},"comment":{"url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/comments/161931755","html_url":"https://github.com/lambdalisue/jupyter-vim-binding/issues/27#issuecomment-161931755","issue_url":"https://api.github.com/repos/lambdalisue/jupyter-vim-binding/issues/27","id":161931755,"user":{"login":"greenify","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/greenify","html_url":"https://github.com/greenify","followers_url":"https://api.github.com/users/greenify/followers","following_url":"https://api.github.com/users/greenify/following{/other_user}","gists_url":"https://api.github.com/users/greenify/gists{/gist_id}","starred_url":"https://api.github.com/users/greenify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenify/subscriptions","organizations_url":"https://api.github.com/users/greenify/orgs","repos_url":"https://api.github.com/users/greenify/repos","events_url":"https://api.github.com/users/greenify/events{/privacy}","received_events_url":"https://api.github.com/users/greenify/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T10:28:45Z","updated_at":"2015-12-04T10:28:45Z","body":"> Hum... This would change the concept of jupyter-vim-binding so I should be really careful to decide.\r\nMy current questions are\r\n\r\nNo worries - this is just a general idea that I had ;-)\r\n\r\n> Some keymaps are conflicted with Vim's mapping (e.g. Shift-g, Ctrl-u, etc.) and I don't really think we should change the behaviour of Vim mode\r\n\r\nHmm we could always remap them or use another leader key?\r\n\r\n> Staying always in edit mode have a potential to cause some problem on other plugins\r\n\r\nHow about making this an opt-in option until we have figured out whether this would conflict with other plugins?\r\n\r\n> Let me know more positive points.\r\n\r\nWell the main advantage of working purely in a \"VimMode\" are (1) is it's less confusing in which mode one currently is in (2) it's faster because one doesn't need to switch from command to edit mode all the time. I was annoyed a lot by needing to switch back to the command mode for daily actions like running a cell, toggling the output or deleting the cell.\r\n\r\nIf you don't like this so much, I can also add this to the wiki and we wait on the feedback from other users ;-)"}}