Kill default buffer (with cursor)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Windows 10, Emacs 25.1, Helm



I open 3 buffers (3 files).
Show only 2 buffers.



enter image description here



As you can see the current buffer is my_buffer_1 because cursor is in this buffer.
I want to kill this current buffer.



M-x kill-buffer


But Emacs ask me what exactly buffer I want to kill.
enter image description here



I select my_buffer_1 and press Enter. As result buffer is killed.
enter image description here



Is it possible Emacs to not ask me about buffer name and kill default (with cursor) buffer? In my case this is a my_buffer_1.







share|improve this question
























    up vote
    2
    down vote

    favorite












    Windows 10, Emacs 25.1, Helm



    I open 3 buffers (3 files).
    Show only 2 buffers.



    enter image description here



    As you can see the current buffer is my_buffer_1 because cursor is in this buffer.
    I want to kill this current buffer.



    M-x kill-buffer


    But Emacs ask me what exactly buffer I want to kill.
    enter image description here



    I select my_buffer_1 and press Enter. As result buffer is killed.
    enter image description here



    Is it possible Emacs to not ask me about buffer name and kill default (with cursor) buffer? In my case this is a my_buffer_1.







    share|improve this question






















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Windows 10, Emacs 25.1, Helm



      I open 3 buffers (3 files).
      Show only 2 buffers.



      enter image description here



      As you can see the current buffer is my_buffer_1 because cursor is in this buffer.
      I want to kill this current buffer.



      M-x kill-buffer


      But Emacs ask me what exactly buffer I want to kill.
      enter image description here



      I select my_buffer_1 and press Enter. As result buffer is killed.
      enter image description here



      Is it possible Emacs to not ask me about buffer name and kill default (with cursor) buffer? In my case this is a my_buffer_1.







      share|improve this question












      Windows 10, Emacs 25.1, Helm



      I open 3 buffers (3 files).
      Show only 2 buffers.



      enter image description here



      As you can see the current buffer is my_buffer_1 because cursor is in this buffer.
      I want to kill this current buffer.



      M-x kill-buffer


      But Emacs ask me what exactly buffer I want to kill.
      enter image description here



      I select my_buffer_1 and press Enter. As result buffer is killed.
      enter image description here



      Is it possible Emacs to not ask me about buffer name and kill default (with cursor) buffer? In my case this is a my_buffer_1.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 10 at 15:58









      Alexei

      31919




      31919




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote













          Use the function kill-this-buffer. I basically never want to kill buffers that are not the current buffer, so I rebind C-x k to that function:



          (global-set-key (kbd "C-x k") #'kill-this-buffer)


          (Of course, if you ever do wanted to be prompted for a buffer to kill, you can just run M-x kill-buffer, or since you use Helm, kill it from the buffer switcher.)






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "583"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44053%2fkill-default-buffer-with-cursor%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote













            Use the function kill-this-buffer. I basically never want to kill buffers that are not the current buffer, so I rebind C-x k to that function:



            (global-set-key (kbd "C-x k") #'kill-this-buffer)


            (Of course, if you ever do wanted to be prompted for a buffer to kill, you can just run M-x kill-buffer, or since you use Helm, kill it from the buffer switcher.)






            share|improve this answer
























              up vote
              5
              down vote













              Use the function kill-this-buffer. I basically never want to kill buffers that are not the current buffer, so I rebind C-x k to that function:



              (global-set-key (kbd "C-x k") #'kill-this-buffer)


              (Of course, if you ever do wanted to be prompted for a buffer to kill, you can just run M-x kill-buffer, or since you use Helm, kill it from the buffer switcher.)






              share|improve this answer






















                up vote
                5
                down vote










                up vote
                5
                down vote









                Use the function kill-this-buffer. I basically never want to kill buffers that are not the current buffer, so I rebind C-x k to that function:



                (global-set-key (kbd "C-x k") #'kill-this-buffer)


                (Of course, if you ever do wanted to be prompted for a buffer to kill, you can just run M-x kill-buffer, or since you use Helm, kill it from the buffer switcher.)






                share|improve this answer












                Use the function kill-this-buffer. I basically never want to kill buffers that are not the current buffer, so I rebind C-x k to that function:



                (global-set-key (kbd "C-x k") #'kill-this-buffer)


                (Of course, if you ever do wanted to be prompted for a buffer to kill, you can just run M-x kill-buffer, or since you use Helm, kill it from the buffer switcher.)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 10 at 16:23









                Omar

                2,305823




                2,305823



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44053%2fkill-default-buffer-with-cursor%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery