{"id":5355,"date":"2016-06-28T15:28:00","date_gmt":"2016-06-28T19:28:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=5355"},"modified":"2016-06-28T15:28:16","modified_gmt":"2016-06-28T19:28:16","slug":"ivy-switch-buffer","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=5355","title":{"rendered":"Ivy Switch Buffer"},"content":{"rendered":"<p> Since I decided to give <a href=\"http:\/\/irreal.org\/blog\/?p=5340\">swiper, counsel, and ivy<\/a> a try, I&#8217;ve been paying more attention to abo-abo&#8217;s posts concerning them. Although I was aware that <code>ivy<\/code> took control of <code>switch-buffer<\/code>, I didn&#8217;t realize how powerful it is. <\/p>\n<p> Abo-abo has an <a href=\"http:\/\/irreal.org\/blog\/?p=5340\">informative post<\/a> that explains some of those capabilities. When you call <code>ivy-switch-buffer<\/code>, you get a list of not only the currently open buffers but also bookmarks, recently opened files, and window layouts. Ivy calls the window layouts \u201cviews\u201d and for some time you have been able to statically define useful views that you can call up instantly. <\/p>\n<p> With the latest ivy, you can create these view dynamically. Each view captures the window topography, the buffers and any related file in each window, and the position of the point in each window when the view was created. You can have several views with the same window configuration and buffers but with different positions within each buffer. That&#8217;s very useful. <\/p>\n<p> Because of the way views are named, it&#8217;s easy to limit your choices to just views when you call <code>ivy-switch-buffer<\/code>. That makes it especially easy to move directly to the view you want. <\/p>\n<p> Setting all this up is pretty easy. Abo-abo suggests <\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-emacs-lisp\"><span style=\"color: #b22222;\">;; <\/span><span style=\"color: #b22222;\">Enable switching to the ``<\/span><span style=\"color: #008b8b;\">special<\/span><span style=\"color: #b22222;\">'' buffers<\/span>\n(<span style=\"color: #a020f0;\">setq<\/span> ivy-use-virtual-buffers t)\n\n<span style=\"color: #b22222;\">;; <\/span><span style=\"color: #b22222;\">Create and delete a view<\/span>\n(global-set-key (kbd <span style=\"color: #8b2252;\">\"C-c v\"<\/span>) 'ivy-push-view)\n(global-set-key (kbd <span style=\"color: #8b2252;\">\"C-c V\"<\/span>) 'ivy-pop-view)\n<\/pre>\n<\/div>\n<p> but you can, of course, use whatever key sequence you like for pushing and popping views. <\/p>\n<p> I like this idea. I can see how it could enable a new and possibly more efficient workflow for at least some of my tasks. Is anyone out there (besides abo-abo) taking advantage of this? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I decided to give swiper, counsel, and ivy a try, I&#8217;ve been paying more attention to abo-abo&#8217;s posts concerning them. Although I was aware that ivy took control of switch-buffer, I didn&#8217;t realize how powerful it is. Abo-abo has &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=5355\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-5355","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5355"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5355\/revisions"}],"predecessor-version":[{"id":5356,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5355\/revisions\/5356"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}