Atom - changing keyboard shortcuts for defult actions












1















the delete line function in the atom-editor on Mac is assigned to ^ + + k. I've a two questions:




  1. How can I reassign this action to + D?

  2. Follow-up with the first one, is there a convenient way of browsing existing command and assigned keyboard shortcuts?




I would be obliged if the answer would provide a comprehensive extract keymap.cson file and/or any other files that have to be modified to make this work.










share|improve this question



























    1















    the delete line function in the atom-editor on Mac is assigned to ^ + + k. I've a two questions:




    1. How can I reassign this action to + D?

    2. Follow-up with the first one, is there a convenient way of browsing existing command and assigned keyboard shortcuts?




    I would be obliged if the answer would provide a comprehensive extract keymap.cson file and/or any other files that have to be modified to make this work.










    share|improve this question

























      1












      1








      1








      the delete line function in the atom-editor on Mac is assigned to ^ + + k. I've a two questions:




      1. How can I reassign this action to + D?

      2. Follow-up with the first one, is there a convenient way of browsing existing command and assigned keyboard shortcuts?




      I would be obliged if the answer would provide a comprehensive extract keymap.cson file and/or any other files that have to be modified to make this work.










      share|improve this question














      the delete line function in the atom-editor on Mac is assigned to ^ + + k. I've a two questions:




      1. How can I reassign this action to + D?

      2. Follow-up with the first one, is there a convenient way of browsing existing command and assigned keyboard shortcuts?




      I would be obliged if the answer would provide a comprehensive extract keymap.cson file and/or any other files that have to be modified to make this work.







      macos mac keyboard keyboard-shortcuts atom-editor






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 8 '16 at 17:11









      KonradKonrad

      282317




      282317






















          2 Answers
          2






          active

          oldest

          votes


















          4














          Let's start with the second part of your question, since it gives you an understanding of what we're going to do. There are two ways to find existing keybindings:




          1. Open settings, click on Keybindings and type delete-line. Words are usually separated by a single dash, though there are exceptions such as newline.


          2. Install the keybinding-resolver and open it using the Cmd. shortcut. The resolver will display any shortcut as you type.



          Both options will display the triggered command and the selector in which the shortcut is working. In our case the command is editor:delete-line and the selector atom-text-editor:not([mini]). We will use both when creating our custom keybinding.



          Open the keymap from the menu (Atom > Keymap) or the command palette (“Application: Open Your Keymap”). I've commented a working example to explain each step:



          'atom-text-editor:not([mini])':
          # Unbind default Cmd-D shortcut
          'cmd-d': 'unbind!'

          # Assign new shortcut
          'cmd-d': 'editor:delete-line'

          # Optional: Unbind default editor:delete-line shortcut
          'ctrl-shift-k': 'unbind!'


          Hope this helps!






          share|improve this answer


























          • It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

            – Unnikrishnan
            Nov 20 '17 at 6:50



















          0














          Found another discussion and adding the following to the keymap (Atom > Keymap) did the trick for me in Atom 1.34.0 :



          '.platform-darwin atom-text-editor':
          'cmd-d': 'editor:delete-line'





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1063130%2fatom-changing-keyboard-shortcuts-for-defult-actions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Let's start with the second part of your question, since it gives you an understanding of what we're going to do. There are two ways to find existing keybindings:




            1. Open settings, click on Keybindings and type delete-line. Words are usually separated by a single dash, though there are exceptions such as newline.


            2. Install the keybinding-resolver and open it using the Cmd. shortcut. The resolver will display any shortcut as you type.



            Both options will display the triggered command and the selector in which the shortcut is working. In our case the command is editor:delete-line and the selector atom-text-editor:not([mini]). We will use both when creating our custom keybinding.



            Open the keymap from the menu (Atom > Keymap) or the command palette (“Application: Open Your Keymap”). I've commented a working example to explain each step:



            'atom-text-editor:not([mini])':
            # Unbind default Cmd-D shortcut
            'cmd-d': 'unbind!'

            # Assign new shortcut
            'cmd-d': 'editor:delete-line'

            # Optional: Unbind default editor:delete-line shortcut
            'ctrl-shift-k': 'unbind!'


            Hope this helps!






            share|improve this answer


























            • It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

              – Unnikrishnan
              Nov 20 '17 at 6:50
















            4














            Let's start with the second part of your question, since it gives you an understanding of what we're going to do. There are two ways to find existing keybindings:




            1. Open settings, click on Keybindings and type delete-line. Words are usually separated by a single dash, though there are exceptions such as newline.


            2. Install the keybinding-resolver and open it using the Cmd. shortcut. The resolver will display any shortcut as you type.



            Both options will display the triggered command and the selector in which the shortcut is working. In our case the command is editor:delete-line and the selector atom-text-editor:not([mini]). We will use both when creating our custom keybinding.



            Open the keymap from the menu (Atom > Keymap) or the command palette (“Application: Open Your Keymap”). I've commented a working example to explain each step:



            'atom-text-editor:not([mini])':
            # Unbind default Cmd-D shortcut
            'cmd-d': 'unbind!'

            # Assign new shortcut
            'cmd-d': 'editor:delete-line'

            # Optional: Unbind default editor:delete-line shortcut
            'ctrl-shift-k': 'unbind!'


            Hope this helps!






            share|improve this answer


























            • It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

              – Unnikrishnan
              Nov 20 '17 at 6:50














            4












            4








            4







            Let's start with the second part of your question, since it gives you an understanding of what we're going to do. There are two ways to find existing keybindings:




            1. Open settings, click on Keybindings and type delete-line. Words are usually separated by a single dash, though there are exceptions such as newline.


            2. Install the keybinding-resolver and open it using the Cmd. shortcut. The resolver will display any shortcut as you type.



            Both options will display the triggered command and the selector in which the shortcut is working. In our case the command is editor:delete-line and the selector atom-text-editor:not([mini]). We will use both when creating our custom keybinding.



            Open the keymap from the menu (Atom > Keymap) or the command palette (“Application: Open Your Keymap”). I've commented a working example to explain each step:



            'atom-text-editor:not([mini])':
            # Unbind default Cmd-D shortcut
            'cmd-d': 'unbind!'

            # Assign new shortcut
            'cmd-d': 'editor:delete-line'

            # Optional: Unbind default editor:delete-line shortcut
            'ctrl-shift-k': 'unbind!'


            Hope this helps!






            share|improve this answer















            Let's start with the second part of your question, since it gives you an understanding of what we're going to do. There are two ways to find existing keybindings:




            1. Open settings, click on Keybindings and type delete-line. Words are usually separated by a single dash, though there are exceptions such as newline.


            2. Install the keybinding-resolver and open it using the Cmd. shortcut. The resolver will display any shortcut as you type.



            Both options will display the triggered command and the selector in which the shortcut is working. In our case the command is editor:delete-line and the selector atom-text-editor:not([mini]). We will use both when creating our custom keybinding.



            Open the keymap from the menu (Atom > Keymap) or the command palette (“Application: Open Your Keymap”). I've commented a working example to explain each step:



            'atom-text-editor:not([mini])':
            # Unbind default Cmd-D shortcut
            'cmd-d': 'unbind!'

            # Assign new shortcut
            'cmd-d': 'editor:delete-line'

            # Optional: Unbind default editor:delete-line shortcut
            'ctrl-shift-k': 'unbind!'


            Hope this helps!







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 11 '16 at 7:50

























            answered Apr 9 '16 at 20:05









            idlebergidleberg

            967413




            967413













            • It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

              – Unnikrishnan
              Nov 20 '17 at 6:50



















            • It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

              – Unnikrishnan
              Nov 20 '17 at 6:50

















            It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

            – Unnikrishnan
            Nov 20 '17 at 6:50





            It's not working for me it's showing "Duplicate key 'cmd-d'", what I should do here?

            – Unnikrishnan
            Nov 20 '17 at 6:50













            0














            Found another discussion and adding the following to the keymap (Atom > Keymap) did the trick for me in Atom 1.34.0 :



            '.platform-darwin atom-text-editor':
            'cmd-d': 'editor:delete-line'





            share|improve this answer




























              0














              Found another discussion and adding the following to the keymap (Atom > Keymap) did the trick for me in Atom 1.34.0 :



              '.platform-darwin atom-text-editor':
              'cmd-d': 'editor:delete-line'





              share|improve this answer


























                0












                0








                0







                Found another discussion and adding the following to the keymap (Atom > Keymap) did the trick for me in Atom 1.34.0 :



                '.platform-darwin atom-text-editor':
                'cmd-d': 'editor:delete-line'





                share|improve this answer













                Found another discussion and adding the following to the keymap (Atom > Keymap) did the trick for me in Atom 1.34.0 :



                '.platform-darwin atom-text-editor':
                'cmd-d': 'editor:delete-line'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 17 at 13:48









                marvinmarvin

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1063130%2fatom-changing-keyboard-shortcuts-for-defult-actions%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀