When it comes to working at the command line, there is really no limit to the amount of customization you can do. Sometimes it is hard to know where to start.
These are the three most helpful tools I use.
Seth Brown introduced me to Autojump, and I am extremely grateful.
It tracks which directories you use and lets you jump from one to another. All you have to do is type
j and part of the directory name. So
j arx will take me to
~/code/BibDesk/arxiv2bib, and then
j nb will take me to
~/Sites/nb. It feels like magic.
If you have homebrew, it can be installed with
brew install autojump.
I use this function all the time. Man pages aren’t very useful if they are clogging up the terminal. You can easily adapt this for your text editor.
The second line converts the name of the man page to upper case. This is used in the third line to set a title. The
--clean option makes it so BBEdit doesn’t ask you if you want to save when you close the window.
Put the function definition into
I tried IPython several times before it stuck, but I can’t imagine going back to the standard Python interactive interpreter.
IPython has many, many features, but it is worth it just for the tab completion. Type the name of a variable, add a dot, and press tab to see all of the object’s methods and other attributes. Also, each history item contains the entire command, as opposed to just one line, making it possible to edit that for loop that you messed up.
The thing that kept me out of IPython for so long was that I didn’t like its default settings and didn’t want to figure out how to fix it.
In case this is stopping anyone from having a much better Python experience, here is a condensed version of my
ipython_config.py file for my default profile.
For more information about where this should go, run
ipython profile list.
IPython can be installed with