News for hackers. Stuff that matters.
Re:Vim Creep (2011) by scns on Saturday December 12, 2020 @09:34AM (#25398435)
I have .. as an alias for cd ..
Re:Vim Creep (2011) by IggleSniggle on Saturday December 12, 2020 @10:50AM (#25398957)
Don’t stop there!

... for cd ../..

....

.....

They compose naturally too, ..../targetDir

I use these so frequently and naturally that I forget that they aren’t built-in to my shell.

Also, a shortcut to jump between the last 5 or working directories. Print them with `dirs` and cd to a directory by invoking its number.

Re:Vim Creep (2011) by ramshorns on Saturday December 12, 2020 @11:51AM (#25399538)
How do you make that history? Something like an alias for cd that pushes them onto a queue?
Re:Vim Creep (2011) by IggleSniggle on Saturday December 12, 2020 @12:15PM (#25399758)
`dirs` is a shell built-in for the directory stack. If you supply it with -v, it will number the output. So the trick is just to make these line up, which is also really just using a feature of `cd` that extracts an entry from the directory stack at position n. My aliases look like this:

    alias dirs='dirs -v'
    alias '1'='cd -'
    alias '2'='cd -2'
    alias '3'='cd -3'
etc.

Doesn't seem like it would make a big difference, but it's very fluid and adopts well to whatever "you happen to working on in the moment."

Re:Vim Creep (2011) by thpx86 on Saturday December 12, 2020 @12:06PM (#25399667)
I use "setopt autocd" in zsh. Typing the directory will cd into that directory. Any directory. No aliases.