Things Learned Recently
It's strange how something could be right in front of our eyes and we wouldn't explore or learn it.
We've all known people who use the arrow keys to move the cursor in an editor one character at a time. Or people who use the right-arrow+backspace combination when a simple delete would suffice.
So it's no surprise that I missed a few features in tools I've been using for a long time. For example:
- In Mozilla, I can now set more than one websites as my home page. Simply open them all up in different tabs, and then click on "Use Current Group" in the Navigator Preferences dialog.
- In Windows cmd.exe, %~dp0 is the name of the current script in a batch file.
- In Emacs, you can edit any remote file reachable via ftp as if a local file. Simply visit /server:/path/file. You can even bypass the login promt by saving your username/password in ~/.netrc.
Here's a few tricks I've known for a while, but are worth mentioning because they are so neat:
- In vi, the . command repeats the last insert. This is useful when you want to do the same thing at several places. You do it in the first place, and then move to the next place and issue a . command.
- Emacs can open zip or jar files as directories. You can then open individual entries, edit them, and save. Emacs will rezip the changes right back into the zip or jar file for you.
- Try echo $PATH | tr : \\n. It will split your PATH into individual elements and display them one per line.