News for hackers. Stuff that matters.
Re:Zsh Tricks to Blow Your Mind by j-james on Thursday February 18, 2021 @12:51AM (#26176432)
A lot of these can be easily done in Bash, too!

1. `mkcdir () { mkdir -- "$1" && cd -- "$1"; }`

2a. `bind '"\e[A":history-search-backward'; bind '"\e[B":history-search-forward'`

2b. Default behavior for Bash.

3. `shopt -s autocd`

4. `mmv`, `perl-rename`

5. `qalc` from libqalculate: https://github.com/Qalculate/libqalculate

8. Default behavior for Bash.

9. Default behavior for Bash.

Re:Zsh Tricks to Blow Your Mind by deadbunny on Thursday February 18, 2021 @02:09AM (#26176897)
This is always my complaint about posts like this. I read them looking for the killer feature to make me consider switching from bash and it's always stuff bash does natively or with a one line alias.
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @07:59AM (#26179284)
As many others here have noted, terse syntax for things like `repeat` loops or normal `for`/`while` loops or shell var expansion can all be addictive, but some specific things I miss in Bash that are easy in Zsh are:

    1) auto cd to any evar just from its name
       e.g. lb=/usr/local/bin; lb
       ($lb works in bash, but I always forget
       the $.  I know I could do aliases...Yuck.)

    2) auto cd does not seem to use $CDPATH
       this is a real pain since I am used to
       never typing "cd ".

    3) **c instead of **/*c for a recursive glob
       At 2 vs. 4 chars (or 3 vs. 6 keydowns) it
       may not *look* much briefer, but it feels
       much easier to type once you're used to it.

    4) On the fly command line colorization along
       the lines of zsh-syntax-highlighting.
       Spot syntax errors/missing cmds *before*
       you hit <ENTER>.

    5) vared MyVar
       Use the ZLE to easily modify any evar.

    6) Zsh's REPORTTIME
       *automatically* report time/memory of only
       "expensive" programs/pipelines.

    7) Zsh's extended history format that includes
       both the time started as well as *duration*
       of all my commands.

    8) Floating point arithmetic and $[]
       forget all this calculator jazz.  I just
       do `alias ec=echo` and go `ec $[1234./56]`
       or even just : $[1234./56]<TAB>

    9) glob qualifiers (forget `find` or `fd`)
       My main use cases are *(.) *(@) & *(/),
       sometimes with a ^ for "not" in there,
       e.g. *(^/).  The codes are mostly the
       old ls -F codes to be easy to recall.
If anyone knows how to make Bash do any of those, I would appreciate the tip. Otherwise, maybe they count as "killer" features to someone.

Also, I tend to use a global alias "/n" for "/dev/null". I know I could just use $n with n=/dev/null, but I enjoy having it look like a path in / that never actually exists.

Re:Zsh Tricks to Blow Your Mind by chrisshroba on Thursday February 18, 2021 @09:52AM (#26180420)
> Zsh's extended history format that includes both the time started as well as duration of all my commands.

Woah, how do I enable this? From what I can tell this information is not being stored in $HISTFILE:

  ...
  : 1613659860:0;sleep 1
  : 1613659863:0;sleep 3
  : 1613659871:0;exec zsh
  : 1613659880:0;vim $HISTFILE
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @10:11AM (#26180673)
Not sure why you are getting all zeros in your duration column. Should be setopt ExtendedHistory (Zsh setopts, like Nim identifiers, are "style insensitive").

From the Zsh man page:

EXTENDED_HISTORY <C> Save each command's beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. The format of this prefixed data is: `: <beginning time>:<elapsed seconds>;<command>'.

(EDIT: My best guess explanation is some competing/conflicting setopt, but the Zsh mailing list could almost surely help you. Also, `history -fD` may show the correct answer even if the saved file has all 0s.)

Re:Zsh Tricks to Blow Your Mind by chrisshroba on Thursday February 18, 2021 @10:21AM (#26180793)
Thank you! How strange. `history -fD` does work, but only for commands in the current zsh session. It seems durations are being stored in memory but written out as 0's. I'll try the mailing list soon :)
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @10:38AM (#26181046)
Looks like you probably also have SHARE_HISTORY set? [1]

[1] https://unix.stackexchange.com/questions/396809/zsh-share-hi...

Re:Zsh Tricks to Blow Your Mind by jolmg on Thursday February 18, 2021 @11:57AM (#26182293)
In my case, I have INC_APPEND_HISTORY enabled. It appears I get 0 in the duration column because it's writing to the history file before executing the command. I see there's the alternative option INC_APPEND_HISTORY_TIME to append to history after the command finishes in order to include the duration.

It makes sense. It's preferring to add to history immediately so that it's available to other shells without having to wait for the command to finish.

From the manpage:

> INC_APPEND_HISTORY_TIME This option is a variant of INC_APPEND_HISTORY in which, where possible, the history entry is written out to the file after the command is finished, so that the time taken by the command is recorded correctly in the history file in EXTENDED_HISTORY for‐ mat. This means that the history entry will not be available immediately from other instances of the shell that are using the same history file. This option is only useful if INC_APPEND_HISTORY and SHARE_HISTORY are turned off. The three options should be considered mutually exclusive.

Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @12:03PM (#26182395)
Hah. @jolmg & I almost collided to the second. :-) That stackexchange link had an answer with the INC_APPEND_HISTORY_TIME setopt which seems to work without SHARE_HISTORY (I think using his whole stackexchange answer might still result in 0s..at least it did for me when I ran it in a precmd() instead of adding the hook, but it could always be something else varying between his & my setopts).
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @11:58AM (#26182303)
Read this thread [1] at the Zsh mailing list to the end.

It looks like either share_history or inc_append_history break recording duration in a fundamental way. The TL;DR is that the history line is written out before the command in question completes. I guess the thinking is that inc/shared history with some very long running command is not as useful if you wait until it ends and you have elapsed time data to append that line. I feel like that might be a personal issue - like if you almost only ever run commands 1-90 seconds then you are fine with the delay.

Anyway, this also explains why it is available from the `history -fD` command but not in the file.

[1] https://www.zsh.org/mla/workers/2011/msg01297.html

Re:Zsh Tricks to Blow Your Mind by tux1968 on Thursday February 18, 2021 @02:24PM (#26184284)
For your #8 a function might be helpful to remove the $[] characters.

     $ function c;{echo $[$*]}
     $ c 1234./56
     22.035714285714285
     $ a=33;c a / 3
     11
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @02:35PM (#26184405)
If I did that & something for bash that used awk | python to do FP arithmetic I might be able to evolve to a more "portable habit/muscle memory" even if Bash never learns FP arithmetic. Solid suggestion, @tux1968. Thanks. { EDIT: 1 down, a dozen to go! lol :-) and I'll go with a(){..} for a)rithmetic not c since I use that for clear. }
Re:Zsh Tricks to Blow Your Mind by dchess on Thursday February 18, 2021 @12:18PM (#26182594)
What's Yuck about using aliases? I use those extensively. Is that a bad practice?
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @12:38PM (#26182892)
I use aliases, too. But an alias for every possible "bookmarked" directory seems excessive. Like this guy [1] in the current thread, I tend to just say x=`pwd` (no need to always `export`). Agreed there is probably a way to set up a shell function `a() {...}` that establishes an alias (or even a shell function) almost as simply, but another problem that remains is that aliases and variables are separate namespaces. So, if you do it the variable way like Zsh then you don't have to worry about clobbering some existing alias or shell function. You do have to keep these separated namespaces in your head, but the updating of the prompt to the variable name is a pretty good reinforcement cue (at least for me, in practice). Also, the variable lets you use it in composed paths like `$x/bin/foo` while an alias/function would only change your directory.

TL;DR - Yuck = namespace squishing in this application only, but then again one man's "collapse of namespaces being yucky" is another's "yay, I do not have to remember 3..4 namespaces!".

EDIT: for what it's worth, I never intended my 9..11 items to be "in order of importance or persuasiveness". Mostly in order of personally driving me batty when I use Bash and just meant to actually be things Zsh could do that (present)Bash could not, to my knowledge due to @deadbunny's complaint. I do try to keep a side Bash config that is as close as possible to my Zsh config, because it's not always worth my time to compile/install Zsh on a system. But when I do that and start using Bash, I notice all these missing things. { That's why I would genuinely appreciate anyone who knows how to replicate them in Bash saying how. I'm not just "daring the Bash apologists to a challenge" or whatever. :-) }

[1] https://news.ycombinator.com/item?id=26177537

Re:Zsh Tricks to Blow Your Mind by arve0 on Thursday February 18, 2021 @02:25PM (#26184290)
One yuck about aliases, it doesn’t give you autocomplete. See abbr in fish shell for an alternative.
Re:Zsh Tricks to Blow Your Mind by jolmg on Thursday February 18, 2021 @12:53PM (#26183105)
9 goes quite far. My most common uses are downloads/*(oc[1]) for the latest downloaded file (order by time of inode change and return just first result), or downloads/*(c0) for all the files downloaded today (created 0 days ago in downloads directory).

10) =() expansion. It's like <() which both bash and zsh have, but instead of substituting with the path to a pipe, it substitutes with the path to a temporary regular file. Sometimes pipes don't suffice. For example, I can do `viewnior =(maim -s)` to select a region of the screen and see it in an image viewer immediately. `viewnior <(maim -s)` fails because viewnior can't display an image from a pipe.

11) short syntax for control structures. For example, you can do `for x in $(xs); foo $x` without bothering with `do` and `done`.

12) variable expansion in brace expansion. In bash, `x=5; echo {3..$x}` outputs `{3..5}`. zsh outputs `3 4 5`.

13) Command can be just redirection without any executable. `<<< foo` is equivalent to `cat <<< foo`, `> foo.txt` is equivalent to `cat > foo.txt`.

14) Able to convert numbers between any bases. To convert base-5 10 to base-4: `<<< $(( [#4] 5#10 ))` outputs `4#11` which means 11 in base-4.

15) Named directories. I have my project files organized under deep directories like ~/work-for/.../.../.../foo/, and have configured all those as named directories to be able to access them as `~foo`, for instance. Different from using simple variables for this, named directories are compacted when presented by the shell. So in my prompt, I see my current directory is e.g. `~foo/bar` instead of the whole thing from the home dir. Named directories come in 2 forms, static and dynamic. Static named dirs are when you set them up in a hash of name => directory. Dynamic named dirs are when you define a function that expands arbitrary names to paths and compacts arbitrary paths to names.

16) `=foo` expands to the full path of executable foo. So you can, e.g. see the source of `pass` with `less =pass`.

17) Variable expansion syntax, glob qualifiers, and history modifiers can be combined/nested quite nicely. For example, this outputs all the commands available from $PATH: `echo ${~${path/%/\/*(*N:t)}}`. `${~foo}` is to enable glob expansion on the result of foo. `${foo/%/bar}` substitutes the end of the result of foo to "bar" (i.e. it appends it); when foo is an array, it does it for each element. In `/*(*N:t)`, we're adding the slash and star to the paths from `$path`, then the parentheses are glob qualifiers. `*` inside means only match the executables, `N` is to activate NULL_GLOB for the match so that we don't get errors for globs that didn't match anything, `:t` is a history mod used for globs that returns just the "tail" of the result, i.e. the basename. IIRC, bash can't even nest multiple parameter expansions; you need to save each step separately.

18) Suffix aliases can be used to define how to open arbitrary files. `./foo.mp4` opens it up in with `mpv`, because I have `alias -s mp4=mpv`.

19) Global aliases are useful for expanding stuff anywhere. For example, I have `alias -g %LD='~/downloads/*(oc[1])'` so that `%LD` expands to the latest download as part of any argument to a command.

20) Globbing flags. There are various flags for globbing, that enable e.g. backreferences in globs, allow n-number of errors while matching (approximate matching), etc. The only one I've really used though is `i` which enables a glob to be case-insensitive. So `(#i)*.pdf` matches `foo.pdf` as well as `bar.PDF`.

21) Multios. You can use multiple files in individual redirections. For example, `foo > bar | baz` is equivalent to `foo | tee bar | baz`. That accepts globbing and brace expansion too: `foo > *.{c,h}` is the same as `foo | tee *.{c,h}`. Also works for reading: `foo < *.txt` is practically the same as `cat *.txt | foo`. I must admit that I haven't really used this, though.

Re:Zsh Tricks to Blow Your Mind by oblio on Thursday February 18, 2021 @07:37AM (#26179102)
It's because these posts are late.

Do you know why "bash does [these things] natively"? Because zsh had them 20 years ago when bash was barebones and people were envious and over time bash started copying these features over. Sometimes poorly.

And for the "one line alias", in a bunch of cases it's with additional commands, which are not always available, the most famous example being rename.

Which rename? The binutils one (I think) or the Perl one (which has more features)?

Does your distro even package both?

Things can be a lot more complex than they seem.

Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @08:21AM (#26179486)
I agree. I have been using Zsh since about early 1993. I went through a pretty thorough "first I'll convert to tcsh!" then "to Bash!" then "to Zsh!" evaluation back then and Zsh was absolutely the clear winner.

While Bash has "caught up" some in the ensuing decades by copying features (some poorly as you note), I think it still misses quite a few nice "usability" features. I've listed some here [1] from memory, but I am probably forgetting other pretty nice ones. Like maybe ${(f)"$(mycmd)"} to split the output of `mycmd` strictly by newlines. (or ps:\0: for even stricter splitting).

[1] https://news.ycombinator.com/item?id=26176897

Re:Zsh Tricks to Blow Your Mind by mhitza on Thursday February 18, 2021 @03:57AM (#26177537)
Honestly you probably can do these with bash as well with some tweaking. But on a daily basis these are most used by me

    auto_pushd
Replaces internally cd with pushd (plus a few more: to ignore dups, be silent about it).

Global aliases (interpolated anywhere in the commandline)

    alias -g G='| grep -i'
    cat file G something

Replace on the fly long directory names with short paths

    /some/long/path $ export X=`pwd`
    ~X $ 
All the tweaks to ignore dups in the history, when saving/searching.
Re:Zsh Tricks to Blow Your Mind by cb321 on Thursday February 18, 2021 @12:48PM (#26183040)
Short form loops are also great. Someone mentioned short for loops already, but I don't think anyone has mentioned these beauties:

    repeat 10 echo hi
    while {sleep 1} echo hi
Re:Zsh Tricks to Blow Your Mind by petepete on Thursday February 18, 2021 @02:39AM (#26177072)
I'm happy in zsh or bash but the one thing I love in zsh is that completion options for program arguments. Having a list with a snippet of documentation to tab through is a huge benefit.
Re:Zsh Tricks to Blow Your Mind by caymanjim on Thursday February 18, 2021 @02:44AM (#26177100)
Bash supports completions as well.
Re:Zsh Tricks to Blow Your Mind by p_l on Thursday February 18, 2021 @02:50AM (#26177151)
IIRC, bash doesn't support extended completion editor features of ZSH, which GP alluded to - like generating a table of options with help strings that can be selected by arrow keys and the like.
Re:Zsh Tricks to Blow Your Mind by Symbiote on Thursday February 18, 2021 @09:59AM (#26180527)
A (slightly contrived) example:

  > rsync --e«TAB»
  Completing file
  some-file-with-extra-hyphens
  Completing host
  a-n-example.local
  Completing option
  --cvs-exclude                      -- auto-ignore files the same way CVS does
  --delete-excluded                  -- also delete excluded files on the receiving side
  --exclude                          -- exclude files matching pattern
  --exclude-from                     -- read exclude patterns from specified file
  --executability                    -- preserve executability
  --ignore-existing                  -- ignore files that already exist on receiving side
  --ignore-non-existing  --existing  -- ignore files that do not exist on receiving side
There are various ways to present the completion; I have the simple "keep typing letters" way, but Zsh can also present a table with an entry to highlight.
Re:Zsh Tricks to Blow Your Mind by meepmorp on Thursday February 18, 2021 @03:11AM (#26177271)
If the dizzying assortment of shell parameter expansion features (see man zshexpn), isn't enough to convince you, then the cause is lost.
Re:Zsh Tricks to Blow Your Mind by antonvs on Thursday February 18, 2021 @03:36AM (#26177414)
A "dizzying assortment of features" is not automatically a good thing.

The features need to be able to do useful things better somehow, and that's where articles demoing such applications come in.

"Better" also doesn't necessarily mean "more concise," otherwise APL would be one of the best programming languages. A language with a smaller number of accessible, comprehensible, memorable features can prove more useful in practice than one with a "dizzying assortment" that's hard to remember, difficult to read, etc.

Re:Zsh Tricks to Blow Your Mind by Symbiote on Thursday February 18, 2021 @10:04AM (#26180600)
I've used Zsh for 15 years or more, and when I started I read the manual. (I realize this is unthinkable nowadays.)

I noted down the things I thought would be useful day-to-day, and started using them. A few months later, I skimmed through the manual again. I still do so, every year or two. My work gradually changes, and I find Zsh has features that are now useful to me.

This is the suggested manpage: https://linux.die.net/man/1/zshexpn

Re:Zsh Tricks to Blow Your Mind by antonvs on Sunday February 21, 2021 @06:26PM (#26218414)
There are an endless number of programs I could be using. There are an endless number of programs you could be using.

The issue is how to decide whether something is worth looking at.

An article which gives examples that can easily be achieved by some more mainstream system is unconvincing. That's what was being discussed here:

> This is always my complaint about posts like this. I read them looking for the killer feature to make me consider switching from bash and it's always stuff bash does natively or with a one line alias.

> This is the suggested manpage: https://linux.die.net/man/1/zshexpn

Yes, the comment I replied to already suggested that. You're not doing much to convince me that your judgment is worth respecting.

Re:Zsh Tricks to Blow Your Mind by wtetzner on Thursday February 18, 2021 @10:46AM (#26181175)
#7 is one of my favorite zsh features though, even though it doesn't seem like that big of a deal if you haven't used it.
Re:Zsh Tricks to Blow Your Mind by m1keil on Thursday February 18, 2021 @02:45AM (#26177111)
defaults matter.
Re:Zsh Tricks to Blow Your Mind by dbrgn on Thursday February 18, 2021 @04:10AM (#26177627)
Yes, but on the other hand most proponents of zsh have installed ohmyzsh and a dozen plugins. (Just like a lot of long-time users have a long .bashrc.)
Re:Zsh Tricks to Blow Your Mind by deadbunny on Thursday February 18, 2021 @06:58AM (#26178821)
And the default shell on all my machines is bash ;)
Re:Zsh Tricks to Blow Your Mind by wodenokoto on Thursday February 18, 2021 @06:06AM (#26178436)

    for el in `mycommand`; myothercmd $el
That's my killer feature at least. I usually write my scripts in bash, but for one liners in interactive mode, the simplified syntax is a god send.
Re:Zsh Tricks to Blow Your Mind by grtehy on Thursday February 18, 2021 @02:13AM (#26176913)
While I agree that these are not killer features, I'd suggest reading more about zsh. It's not meant to "replace" bash. It's meant to be easily extensible (addons, etc.) The target is folks that stay from bash scripting.
Re:Zsh Tricks to Blow Your Mind by thomasahle on Thursday February 18, 2021 @07:24AM (#26179009)
> 4. `mmv`, `perl-rename`

I didn't have this on my system. I like the article because this was a command I've needed many times without realizing it.

Re:Zsh Tricks to Blow Your Mind by j-james on Friday February 19, 2021 @05:42AM (#26191624)
You may also like the renameutils programs that let you freely manipulate file names in your text editor.

https://www.nongnu.org/renameutils/

Re:Zsh Tricks to Blow Your Mind by akavel on Thursday February 18, 2021 @03:44AM (#26177458)
7. in bash, I use the: [Esc], [#] combo, equivalent to: [Alt]-[Shift]-[3] (a.k.a.: "M-#" in the official docs).

This is a shortcut which basically prefixes the current line with '#' comment character and then simulates hitting Enter (pushing the commented-out line into history buffer).

Re:Zsh Tricks to Blow Your Mind by mkl on Thursday February 18, 2021 @04:05AM (#26177589)
And then the inverse operation, uncommenting and running, is "M-3 M-#" (any number will do, but 3 is on the same key as #).
Re:Zsh Tricks to Blow Your Mind by marvingardens on Thursday February 18, 2021 @01:55AM (#26176812)
Bash supports at least a subset of emacs motion keys.

7. C-a C-k <enter other command> C-y # to park a command

Re:Zsh Tricks to Blow Your Mind by cle on Thursday February 18, 2021 @03:14AM (#26177297)
These are provided by Readline. Many command line programs support Readline, and for those that don’t, rlwrap is like magic (even automatically adds history!).
Re:Zsh Tricks to Blow Your Mind by m463 on Thursday February 18, 2021 @02:10AM (#26176901)
Well, actually... Using C-x C-e you can use EVERY key emacs offers.

(since it invokes your editor, and you can configure it to be emacs)

Re:Zsh Tricks to Blow Your Mind by rootlocus on Thursday February 18, 2021 @01:10AM (#26176539)
> 5. `qalc` from libqalculate: https://github.com/Qalculate/libqalculate

Or, you know, any REPL available.

Re:Zsh Tricks to Blow Your Mind by alpaca128 on Thursday February 18, 2021 @01:40AM (#26176714)
Or a simple `=() { bc -l <<< "scale=10;$1" }` in the usual bash file and you can use bc to do calculations by starting with a =.

Just a little shortcut but REPLs like Python's take a while to spin up, so it's pretty convenient.

Re:Zsh Tricks to Blow Your Mind by xorcist on Thursday February 18, 2021 @02:15AM (#26176926)
That's a nifty idea!

Maybe without lower scale and with the semicolon:

  = () { bc -l <<< "$*"; }
"Stealing" the equals sign for this purpose feels a bit risky, but maybe it isn't.
Re:Zsh Tricks to Blow Your Mind by JNRowe on Thursday February 18, 2021 @05:57AM (#26178391)
I'd guess that xorcist added a space at the end of the function name because zsh uses =( to specify one type of process substitution. Without the space or an escape for = zsh will error on alpaca128's definition believing you wanted something else entirely.

To that point zsh has some excellent additions for process substitution beyond bash's <(list), but it also makes for yet more weird incompatibilities for when that matters. I only looked at this to start with because I assumed the space was because =() would have been treated as the full path modifier for a command called (), because it would mean that with any other character including other bracket types. TIL.

Re:Zsh Tricks to Blow Your Mind by deadbunny on Thursday February 18, 2021 @07:05AM (#26178878)
> Just a little shortcut but REPLs like Python's take a while to spin up, so it's pretty convenient.

Really? Loading python takes basically 0 seconds for me... the slowest I could get running `time python3` and hitting ctrl-d (to exit) is like 0m0.104s.

Re:Zsh Tricks to Blow Your Mind by stjohnswarts on Friday February 19, 2021 @12:24AM (#26190064)
python comes up in way less than a second on my old mac air?
Re:Zsh Tricks to Blow Your Mind by JNRowe on Thursday February 18, 2021 @06:29AM (#26178602)
It isn't shown in TFA, but the zcalc keymap is bindable in the line editor so not only can you use it like qalc/irb/luap/whatever you can also take advantage of any other functionality of zsh within it. Admittedly, you could do some of that with some magic $if/$endif guards in your ~/.inputrc if your REPL uses readline, but the integration is nice functionality if you're a heavy zsh user. I think of it more like the expression register in vim or eval-print-expression in emacs.
Re:Zsh Tricks to Blow Your Mind by enriquto on Thursday February 18, 2021 @05:19AM (#26178130)
my favourite is pari/gp, that can be used as a simple calculator, but also has quite fancy math at your fingertips. For example, it is the easiest way to compute entire series: you type "exp(sin(x))" and you get "1+x+1/2*x^2-1/8*x^4-1/15*x^5 ..."
Re:Zsh Tricks to Blow Your Mind by nicwolff on Thursday February 18, 2021 @02:35PM (#26184400)
7. alt-# to comment and accept the current line, alt-1 alt-# to uncomment and execute it

https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash....

Re:Zsh Tricks to Blow Your Mind by mkl on Thursday February 18, 2021 @04:03AM (#26177581)
Re 1., if you put a -p on the mkdir it becomes a bit more powerful. I've had equivalents of that command going back to DOS batch files on a 286. I've always called it "ad", for "add directory" (though I'll concede that's mainly a good name because it's short).
Re:Zsh Tricks to Blow Your Mind by Spivak on Thursday February 18, 2021 @12:50PM (#26183065)
The one thing I really don’t want to live without is “intellisense” that changes the default input to a prefix-search that ghosts the top result ahead of your typing.

The feature was stolen from fish it’s 100% worth it to me.

Re:Zsh Tricks to Blow Your Mind by aklemm on Thursday February 18, 2021 @12:36PM (#26182864)
Thank goodness, I can close this tab with no fomo.