johncmunson / osx-dev-setup

High level overview for setting up homebrew, git, zsh, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

John's OS X Dev Setup

TODO:

  • Consider getting rid of oh-my-zsh and seeing if you can still have an excellent zsh experience without it.
    • Get rid of the zsh framework (oh-my-zsh), and instead use the official zsh plugin manager (antigen)
    • To get a solid command prompt, try pure
    • Or, you can add the following snippet to .zshrc. It will show your git branch, and it will add a newline between cli commands.
      # Customize the Prompt
      # https://www.themoderncoder.com/add-git-branch-information-to-your-zsh-prompt/
      # https://superuser.com/a/986820
      autoload -Uz vcs_info
      precmd() { vcs_info }
      zstyle ':vcs_info:git:*' formats 'on branch %b'
      setopt PROMPT_SUBST
      NEWLINE=$'\n'
      PROMPT='${NEWLINE}${PWD/#$HOME/~} ${vcs_info_msg_0_} > '
      
    • To get history cycling with the up/down arrows, add these two lines to .zshrc
      bindkey "^[[A" history-beginning-search-backward
      bindkey "^[[B" history-beginning-search-forward
      
  • Consider zsh-autosuggestions
  • Consider adding this to the python section. In general, the stuff regarding Python needs reviewed.
  • Consider installing additional goodies such as... fzf, fd, ripgrep, the silver searcher, ondir, stgit, etc.
  • Maybe, just maybe, try Fish instead of Zsh
  1. Configure what happens when holding a key down. The default is to get a popup for special characters, but I would rather have the keystroke repeat. Also, go to System Preferences -> Keyboard and increase "Key Repeat" and "Delay Until Repeat".
$ defaults write -g ApplePressAndHoldEnabled -bool false
  1. Install xcode from the app store. Then install the xcode command line tools $ xcode-select --install (optional)

    • May already be installed on newer versions of macOS
  2. Install homebrew

  3. Use homebrew to install zsh and change to the default shell. The method of doing this might change once Zsh becomes the standard macOS shell.

  4. Homebrew shell completions might already be working at this point, but if not you can install them

  5. Use the n-install script to install n without having to install node first. n-install also comes with scripts for updating and uninstalling n itself.

  6. Install yarn using brew install yarn. Because yarn installs it's own version of node as a dependency, there's a chance that you might need to update $PATH in .zshrc so that the path to the node installed by n comes before the version install by yarn. Add this right below the N_PREFIX variable... export PATH=$N_PREFIX/bin:$PATH

Alternative method: Install n the normal way with npm. Still install yarn with homebrew. See this issue if you run into permissions issues with n.

  1. Use homebrew to install git

  2. Install oh-my-zsh

  3. Use homebrew to install zsh-syntax-highlighting and update .zshrc accordingly.

  4. Use homebrew to install zsh-completions and update .zshrc accordingly. However, the instructions in the homebrew link are incomplete. They fail to mention that you have to update $fpath after oh-my-zsh is sourced, and then you also need to call autoload -Uz compinit && compinit. If installed successfully, git tab completions should be working. All together now...

source $ZSH/oh-my-zsh.sh
fpath=($(brew --prefix)/share/zsh-completions $fpath)
autoload -Uz compinit && compinit
If you aren't using oh-my-zsh, then here are the steps for installing zsh-completions...
    - brew install zsh-completions
    - [update `.zshrc`](https://formulae.brew.sh/formula/zsh-completions)
    - You might need to run [compaudit | xargs chmod g-w](https://github.com/zsh-users/zsh-completions/issues/433#issuecomment-619321054)
  1. Install z

  2. Install hub

  3. Install hub-zsh-completions (May not be necessary if hub was installed with Homebrew)

  4. Install git-extras

  5. Install gitsome (optional)

  6. Install diff-so-fancy

  7. Install hyper terminal

  8. Install atom editor. Set the UI Theme and Syntax Theme to One Dark.

  9. Install Fira and make Fira Mono the default editor and terminal font. Also, use Operator Mono and Inter.

  10. Install docker for mac and docker zsh completions

  11. Use homebrew to install vim... brew install vim

  12. Use homebrew to also install neovim

  13. Install the vim plugin manager vim-plug

  14. Install vim-mode-plus for Atom

  15. Use homebrew to install pyenv. Place this inside of ~/.zshenv

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi
  1. Use homebrew to install pipenv. Add the following to .zshrc
# If set, creates .venv in your project directory. Default is to create new virtual environments in a global location.
export PIPENV_VENV_IN_PROJECT=1
# pipenv shell completions
eval "$(pipenv --completion)"

About

High level overview for setting up homebrew, git, zsh, etc.