{"id":56,"date":"2012-05-14T19:19:00","date_gmt":"2012-05-14T19:19:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=56"},"modified":"2012-05-14T19:19:00","modified_gmt":"2012-05-14T19:19:00","slug":"quickly-toggle-last-two-buffers-in-emacs","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=56","title":{"rendered":"Quickly toggle last two buffers in Emacs"},"content":{"rendered":"<p>I don&#8217;t have much interesting stuff to post this month, so I&#8217;ll just go with one little snippet for Emacs. Next months will be better, I promise!<br \/>In Emacs, you can switch buffers by hitting <span style=\"font-family: 'Courier New', Courier, monospace;\">C-x b<\/span> and typing a buffer name. If you just hit <span style=\"font-family: 'Courier New', Courier, monospace;\">C-x b RET<\/span>, Emacs will just go to the last buffer. This is an awful lot of keys for such a simple function. So quite a long time ago, I found this useful small function, but I forgot where. In my config I&#8217;ve bound it to <span style=\"font-family: 'Courier New', Courier, monospace;\">F4<\/span>. I use the function keys quite a bit for file and buffer operations, maybe because I am a big fan of the <a href=\"https:\/\/www.midnight-commander.org\/\">Midnight Commander<\/a>&#8230;<\/p>\n<pre><br \/>(global-set-key [f4] (lambda () <br \/>                      (interactive) <br \/>                      (switch-to-buffer<br \/>                         (other-buffer <br \/>                             (current-buffer) nil)<br \/>                      )))<br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t have much interesting stuff to post this month, so I&#8217;ll just go with one little snippet for Emacs. Next months will be better, I promise!In Emacs, you can switch buffers by hitting C-x b and typing a buffer name. If you just hit C-x b RET, Emacs will just go to the last &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=56\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Quickly toggle last two buffers in Emacs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/56"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}