{"id":6455,"date":"2017-07-27T12:14:00","date_gmt":"2017-07-27T16:14:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=6455"},"modified":"2017-07-27T12:14:27","modified_gmt":"2017-07-27T16:14:27","slug":"collapsing-empty-directories-in-zsh","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=6455","title":{"rendered":"Collapsing Empty Directories in Zsh"},"content":{"rendered":"<p> Earlier this month, I wrote about Fuco1&rsquo;s package to <a href=\"http:\/\/irreal.org\/blog\/?p=6434\">collapse empty directories in dired listings<\/a>. That&rsquo;s a handy thing that lets you avoid clicking through a series of empty directories<sup><a id=\"fnr.1\" class=\"footref\" href=\"#fn.1\">1<\/a><\/sup> to reach the file or directory you really want. <\/p>\n<p> The idea originated with GitHub where <a href=\"http:\/\/karl-voit.at\">Karl Voit<\/a> noticed it and soon became addicted. He started wishing he could do the <a href=\"http:\/\/karl-voit.at\/2017\/07\/23\/zsh-skip-empty-dirs\/\">same sort of thing in zsh<\/a>. In particular, he wanted to have <code>cd<\/code> jump over the empty directories so he didn&rsquo;t have to list all the intermediate directories. With the help of seanliao96 he offers a nice bit of shell code that does just that. <\/p>\n<p> If you&rsquo;re a zsh user, you should take a look at Voit&rsquo;s post and see if you want to adopt his code. As I say, it&rsquo;s a simple shell function that you can paste into your <code>zshrc.local<\/code> so it&rsquo;s easy to experiment with and get rid of if you don&rsquo;t like it. <\/p>\n<div id=\"footnotes\">\n<h2 class=\"footnotes\">Footnotes: <\/h2>\n<div id=\"text-footnotes\">\n<div class=\"footdef\"><sup><a id=\"fn.1\" class=\"footnum\" href=\"#fnr.1\">1<\/a><\/sup> <\/p>\n<div class=\"footpara\">\n<p class=\"footpara\"> By which I mean directories that have only a single entry of another directory. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Earlier this month, I wrote about Fuco1&rsquo;s package to collapse empty directories in dired listings. That&rsquo;s a handy thing that lets you avoid clicking through a series of empty directories1 to reach the file or directory you really want. The &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=6455\">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,37],"class_list":["post-6455","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs","tag-tech"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6455","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=6455"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6455\/revisions"}],"predecessor-version":[{"id":6456,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6455\/revisions\/6456"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}