{"__v":2,"_id":"5507cb3d43d3400d0052fd9d","category":{"__v":9,"_id":"54cfba03bba1a023008741b6","pages":["54cfc9ab5ff7e617002bbdb7","54cfcad9bba1a023008741f9","54d393d769578e0d00273142","54ec5015c0c0ba1700386f82","54ec5032c0c0ba1700386f86","55067ff4f6315e2f007f1a3c","5507cb3d43d3400d0052fd9d","56d6f058c6473c0b00ba88ba","56d6f148c6473c0b00ba88c1"],"project":"54cf411f9d09bb0d00a17a1c","version":"54cf411f9d09bb0d00a17a1f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-02T17:55:15.225Z","from_sync":false,"order":2,"slug":"ide-components","title":"IDE Components"},"parentDoc":null,"project":"54cf411f9d09bb0d00a17a1c","user":"54dd95e5c4a3570d009d490c","version":{"__v":14,"_id":"54cf411f9d09bb0d00a17a1f","project":"54cf411f9d09bb0d00a17a1c","createdAt":"2015-02-02T09:19:27.656Z","releaseDate":"2015-02-02T09:19:27.656Z","categories":["54cf41209d09bb0d00a17a20","54cfb99bbba1a023008741af","54cfb9a65ff7e617002bbd7f","54cfba03bba1a023008741b6","54cfba0ebba1a023008741b8","54cfba19bba1a023008741b9","54cfba29bba1a023008741bb","54cfba345ff7e617002bbd87","54cfba3ebba1a023008741bc","54cfba473995cf0d0006f6f0","54e371b18ef7552300409bf2","54e37aa5e887c50d005ef629","555a4e9b147f91190092d137","56b0e91802f4bc0d006ce254"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-17T06:35:41.442Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"We understand how much an impact the right keybindings make to developers and that each developer has his own personal preferences. For this reason, Cloud9 IDE provides a rich interface to allow customization of keybindings.\n\nTo start, bring up the preferences window\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ip8y5clTSe6X5YlgXgOz_Screen_Shot_2015-03-17_at_11_14_51_am.png\",\n        \"Screen_Shot_2015-03-17_at_11_14_51_am.png\",\n        \"1919\",\n        \"182\",\n        \"#3b5271\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nClick on 'keybindings'\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/hatcbqeRfOjUF4Bt1Zj5_Screen_Shot_2015-03-17_at_11_15_08_am.png\",\n        \"Screen_Shot_2015-03-17_at_11_15_08_am.png\",\n        \"1074\",\n        \"663\",\n        \"#374b69\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nCloud9 provides the following ways to customize keybindings:\n\n- Choose keyboard mode from:\n    - Default\n    - Vim\n    - Emacs\n    - Sublime\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/QgFATdvFS4yqk1UOHaTh_Screen%20Shot%202015-03-17%20at%2011.16.13%20am.png\",\n        \"Screen Shot 2015-03-17 at 11.16.13 am.png\",\n        \"454\",\n        \"148\",\n        \"#74a4d7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n- Choose your operating system:\n    - Apple OS X\n    - Windows / Linux\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/SWB602X7SkCedbMNEpcx_Screen%20Shot%202015-03-17%20at%2011.16.22%20am.png\",\n        \"Screen Shot 2015-03-17 at 11.16.22 am.png\",\n        \"434\",\n        \"111\",\n        \"#874736\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n- Change standard keybindings to your own preferences\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to change a keybinding\"\n}\n[/block]\n\nThe best way to start is by filtering the long list of keybindings to find the right one. You can do that simply by typing in part of the command name within the filter field\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Zb7wtuGjQFWghswt4i7z_Screen%20Shot%202015-03-17%20at%2011.15.37%20am.png\",\n        \"Screen Shot 2015-03-17 at 11.15.37 am.png\",\n        \"1462\",\n        \"362\",\n        \"#4292c5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce you see the command you'd like to customize, just double click on the current keystroke. Once selected, press the key-combo on your keyboard and see the value update. Once you're satisfied, press Enter to save (or press Escape to cancel).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/T8lT2Ty4T6ClxKMUJyT2_Screen%20Shot%202015-03-17%20at%2011.16.35%20am.png\",\n        \"Screen Shot 2015-03-17 at 11.16.35 am.png\",\n        \"922\",\n        \"83\",\n        \"#63abfb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nOf course, resetting the keybindings to default is as easy as clicking the 'Reset to Defaults' button.\n\nAnother way to customize your keybindings is to edit the **keymap file**. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/k7hKqLGsQqW9YNhXacuy_Screen_Shot_2015-03-17_at_11_15_08_am.png\",\n        \"Screen_Shot_2015-03-17_at_11_15_08_am.png\",\n        \"1074\",\n        \"663\",\n        \"#30547a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe main advantage of the keymap file is to share your customized keybindings between your workspaces or with other developers.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"All custom keybindings are automatically stored\",\n  \"body\": \"Whenever you customize keybindings using the preferences window, they are being saved to the keymap file. Therefore, it's not necessary to edit the file manually, instead, just use it to copy over the keybindings to your other workspaces once you're satisfied with the setup.\"\n}\n[/block]\nFor a list of some of the default keybindings, go to the [keybindings doc](doc:keybindings).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Customising Vim Keybindings\"\n}\n[/block]\nVim Keybindings are not in the normal keybindings list. You can customize them by editing your Cloud9 init script found by clicking Cloud9 -> Open your init script and adding something similar to the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require([\\\"plugins/c9.ide.ace.keymaps/vim/keymap\\\"], function(vim) {\\n\\t\\tvim.map(\\\"J\\\", \\\"8j\\\", \\\"normal\\\")\\n\\t\\tvim.map(\\\"K\\\", \\\"8k\\\", \\\"normal\\\")\\n\\t\\tvim.map(\\\",b\\\", \\\"c9:build\\\", \\\"normal\\\")\\n\\t\\tvim.map(\\\",g\\\", \\\"c9:run\\\", \\\"normal\\\")\\n    vim.map(\\\"jk\\\", \\\"<Esc>\\\", \\\"insert\\\")\\n    vim.map(\\\"<C-f>\\\", \\\"c9:find\\\", \\\"normal\\\")\\n    vim.map(\\\"<C-e>\\\", \\\"c9:navigate\\\");\\n    vim.map(\\\"<C-x>\\\", \\\"c9:cut\\\", \\\"normal\\\");\\n    vim.map(\\\"<C-c>\\\", \\\"c9:copy\\\", \\\"normal\\\");\\n    vim.map(\\\"<C-p>\\\", \\\"c9:paste\\\", \\\"normal\\\");\\n});\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThe 1st parameter is the key sequence, the 2nd parameter is what should be run, the 3rd parameter is if this sequence applies in normal vim mode (where you move around via hjkl) or insert mode (where you are inserting text, like a normal text editor). You can exclude the last argument to make the keybinding work in all modes. \n\nUnfortunately there is currently no way to unbind default vim keybindings, only overwrite them. As you can see in the example above it overwrites the vim keybinding for find and navigate so they work as if vim mode was not enabled. \n\nTo discover the name of the command you wish to run (c9:xxxxxx) you can go to preferences -> keybindings and use the name from the \"name\" column.","excerpt":"","slug":"customizing-keybindings","type":"basic","title":"Customizing Keybindings"}

Customizing Keybindings


We understand how much an impact the right keybindings make to developers and that each developer has his own personal preferences. For this reason, Cloud9 IDE provides a rich interface to allow customization of keybindings. To start, bring up the preferences window [block:image] { "images": [ { "image": [ "https://files.readme.io/ip8y5clTSe6X5YlgXgOz_Screen_Shot_2015-03-17_at_11_14_51_am.png", "Screen_Shot_2015-03-17_at_11_14_51_am.png", "1919", "182", "#3b5271", "" ] } ] } [/block] Click on 'keybindings' [block:image] { "images": [ { "image": [ "https://files.readme.io/hatcbqeRfOjUF4Bt1Zj5_Screen_Shot_2015-03-17_at_11_15_08_am.png", "Screen_Shot_2015-03-17_at_11_15_08_am.png", "1074", "663", "#374b69", "" ] } ] } [/block] Cloud9 provides the following ways to customize keybindings: - Choose keyboard mode from: - Default - Vim - Emacs - Sublime [block:image] { "images": [ { "image": [ "https://files.readme.io/QgFATdvFS4yqk1UOHaTh_Screen%20Shot%202015-03-17%20at%2011.16.13%20am.png", "Screen Shot 2015-03-17 at 11.16.13 am.png", "454", "148", "#74a4d7", "" ] } ] } [/block] - Choose your operating system: - Apple OS X - Windows / Linux [block:image] { "images": [ { "image": [ "https://files.readme.io/SWB602X7SkCedbMNEpcx_Screen%20Shot%202015-03-17%20at%2011.16.22%20am.png", "Screen Shot 2015-03-17 at 11.16.22 am.png", "434", "111", "#874736", "" ] } ] } [/block] - Change standard keybindings to your own preferences [block:api-header] { "type": "basic", "title": "How to change a keybinding" } [/block] The best way to start is by filtering the long list of keybindings to find the right one. You can do that simply by typing in part of the command name within the filter field [block:image] { "images": [ { "image": [ "https://files.readme.io/Zb7wtuGjQFWghswt4i7z_Screen%20Shot%202015-03-17%20at%2011.15.37%20am.png", "Screen Shot 2015-03-17 at 11.15.37 am.png", "1462", "362", "#4292c5", "" ] } ] } [/block] Once you see the command you'd like to customize, just double click on the current keystroke. Once selected, press the key-combo on your keyboard and see the value update. Once you're satisfied, press Enter to save (or press Escape to cancel). [block:image] { "images": [ { "image": [ "https://files.readme.io/T8lT2Ty4T6ClxKMUJyT2_Screen%20Shot%202015-03-17%20at%2011.16.35%20am.png", "Screen Shot 2015-03-17 at 11.16.35 am.png", "922", "83", "#63abfb", "" ] } ] } [/block] Of course, resetting the keybindings to default is as easy as clicking the 'Reset to Defaults' button. Another way to customize your keybindings is to edit the **keymap file**. [block:image] { "images": [ { "image": [ "https://files.readme.io/k7hKqLGsQqW9YNhXacuy_Screen_Shot_2015-03-17_at_11_15_08_am.png", "Screen_Shot_2015-03-17_at_11_15_08_am.png", "1074", "663", "#30547a", "" ] } ] } [/block] The main advantage of the keymap file is to share your customized keybindings between your workspaces or with other developers. [block:callout] { "type": "info", "title": "All custom keybindings are automatically stored", "body": "Whenever you customize keybindings using the preferences window, they are being saved to the keymap file. Therefore, it's not necessary to edit the file manually, instead, just use it to copy over the keybindings to your other workspaces once you're satisfied with the setup." } [/block] For a list of some of the default keybindings, go to the [keybindings doc](doc:keybindings). [block:api-header] { "type": "basic", "title": "Customising Vim Keybindings" } [/block] Vim Keybindings are not in the normal keybindings list. You can customize them by editing your Cloud9 init script found by clicking Cloud9 -> Open your init script and adding something similar to the following: [block:code] { "codes": [ { "code": "require([\"plugins/c9.ide.ace.keymaps/vim/keymap\"], function(vim) {\n\t\tvim.map(\"J\", \"8j\", \"normal\")\n\t\tvim.map(\"K\", \"8k\", \"normal\")\n\t\tvim.map(\",b\", \"c9:build\", \"normal\")\n\t\tvim.map(\",g\", \"c9:run\", \"normal\")\n vim.map(\"jk\", \"<Esc>\", \"insert\")\n vim.map(\"<C-f>\", \"c9:find\", \"normal\")\n vim.map(\"<C-e>\", \"c9:navigate\");\n vim.map(\"<C-x>\", \"c9:cut\", \"normal\");\n vim.map(\"<C-c>\", \"c9:copy\", \"normal\");\n vim.map(\"<C-p>\", \"c9:paste\", \"normal\");\n});", "language": "text" } ] } [/block] The 1st parameter is the key sequence, the 2nd parameter is what should be run, the 3rd parameter is if this sequence applies in normal vim mode (where you move around via hjkl) or insert mode (where you are inserting text, like a normal text editor). You can exclude the last argument to make the keybinding work in all modes. Unfortunately there is currently no way to unbind default vim keybindings, only overwrite them. As you can see in the example above it overwrites the vim keybinding for find and navigate so they work as if vim mode was not enabled. To discover the name of the command you wish to run (c9:xxxxxx) you can go to preferences -> keybindings and use the name from the "name" column.