I keep forgetting this, but it’s really useful when working in the command line so I’m writing it down now. I use the grml zsh configuration in my shell and it has several very good features; a cool one I’d use more often if I could remember the shortcut is “in-place mkdir”. The key sequence is:
That’s Ctrl and x, followed by an uppercase M.
Here’s an example use case: Imagine you’re writing a command to do something with a very long path, like moving a file deep into a source tree
mv File.java src/something/very/long/
except half-way in your realise some of the directories in that path don’t exist. No problem! Usually you’d have to cancel that command, create the missing directories and then type it again. Now you can just type
Ctrl-X, Shift-M, the directories are created and you can just press enter to use them. Much less annoying! This can even work for different directories in the same command; move the cursor to the directory you need and zsh will create that one!
For other useful shortcuts, see the reference card.