Can someone explain :h as the article's description was not clear at all to me what was going on there.
Yeah, I couldn't make that work for me (on Linux or MacOS) .. although I'd love it if there were a way to quickly get 'just the directory' or 'just the filename' in bash with a shortcut, instead of having to resort to $(dirname blah) and so on .. I'm sure there is some way but :h doesn't look to be the shortcut as expected.
$ echo foo bar
foo bar
$ echo !$
echo bar
bar
The bang syntax is for history expansion, so it won't work on directories directly. But you could hack that with something like: $ls /root/my-dir
[...]
$echo !:t
echo my-dir
my-dir