Javascript Coding Conventions

No, not talking about a programming spinoff of Comic-Con. Though, that would be interesting (in non-COVID-19-ier times). I suppose one could argue Comic-Con is that, given there’s probably some overlap between the two crowds (just conjecture). Anyway, Douglas Crockford (author of JSLint)’s style guide for Javascript can be found here.

Where to place Aliases when you have oh-my-zsh installed

Scott Whittaker over at posted the exact information I was looking for.

I recently installed zsh and oh-my-zsh on one of my Macs, and was looking for where to put an alias. I looked in ~/.zshrc, and saw that it noted that if I was running oh-my-zsh, I should place the alias in $ZSH_CUSTOM, which, on my machine is a directory located at /Users/kgreenwell/.oh-my-zsh/custom (you can check this on your own machine with ‘echo $ZSH_CUSTOM’).

Which is fine, but then it left the question: “What should the file inside $ZSH_CUSTOM holding the aliases be called?” Scott’s post answers this quite nicely:

You can call the file anything you like as long as the file extension is .zsh and the file is immediately under the .oh-my-zsh/custom directory, for example .oh-my-zsh/custom/my-aliases.zsh. I found the answer to this in this thread.

He also goes on to note that you can create as many .zsh files in this directory as you’d like, and they’ll all get read, e.g. project1.zsh, project2.zsh, etc. The $ZSH_CUSTOM directory also contains an example.zsh file that gives an idea of what you can do with your .zsh files here. Very handy.

Thank you Scott, for spelling it all out so clearly!

Tech & life musings