• 2 Posts
  • 14 Comments
Joined 3 years ago
cake
Cake day: June 14th, 2023

help-circle



  • These aliases for zsh I use all the time. It’s part of the prezto configuration framework.

    setopt AUTO_CD              # Auto changes to a directory without typing cd.
    setopt AUTO_PUSHD           # Push the old directory onto the stack on cd.
    setopt PUSHD_IGNORE_DUPS    # Do not store duplicates in the stack.
    setopt PUSHD_SILENT         # Do not print the directory stack after pushd or popd.
    setopt PUSHD_TO_HOME        # Push to home directory when no argument is given.
    
    alias d='dirs -v'
    for index ({1..9}) alias "$index"="cd +${index}"; unset index
    

    Type d and enter to list all the directories you’ve recently been in, then type the number at the start of the line followed by enter to immediately cd there.

    Not sure if latest bash can do it the same thing, but some years ago I wrote a script to implement it there too. IIRC it might’ve been the automatic removal of duplicates in dir history that was missing.







  • So far that has never happened because I’m not using that much storage :) But I shut it down when I need to turn off the mains electricity, and for powering it on afterwards the fake wall can be lifted off. It’s just the area underneath the desk so the panel might be smaller than it sounds like, and it hangs on some hooks so it’s fairly easy to remove if you know what you’re doing. Painted in the same colour as the wall, and with some some random junk on the floor in front, it blends in quite well though. I think the risk of burglary is fairly low, so it’s primarily to soothe my own paranoia.