Skip to content

Latest commit

 

History

History

zsh

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

ZSH Setup and Scripts

Notes from using ZSH instead of Bash.

Contains:

  • Custom rc script that configures custom auto completes
  • Alias Script broken out (for custom commands)
  • Remind Script (invoke with r? or ? or remind)
  • EC2 SSH Script (that references $AWS_KEY env variable)
  • ZSH Hook to change node version based on .nvmrc file when changing directories

TBD:

  • [..] Doctor Script (for preparing shell when navigating to projects)
  • [..] init and setup scripts (for install steps below)

FAQ

How do I install the custom shell commands and theme for faster development?

Use setup script

zsh -c "$(curl -fsSl https://raw.githubusercontent.com/devlinjunker/shell/master/zsh/setup.zsh)"

Manual Install

  1. Install:
    • Oh My ZSH
    • [Optional] iTerm?
    • [Optional] MacPorts
    • [Optional] Chrome (think about switch to FF?)
  2. Clone this repo
  3. Add Symbolic Link for all themes to ~/.oh-my-zsh/themes/
  4. Update theme name in ~/.zshrc to bira+gitstatus
  5. Source zshrc.sym from this repo in ~/.zshrc (so it is executed on startup)

Why use ZSH over Bash?

  • ZSH provides autocomplete for git out of the box with autoload -Uz compinit && compinit in zshrc.sym
  • SSH Autocomplete improved with commands in zshrc.sym also (?)

Why use MacPorts over Homebrew?

  • Community seems to be moving away from Homebrew and towards MacPorts
  • https://saagarjha.com/blog/2019/04/26/thoughts-on-macos-package-managers/
  • Sets up tools in isolation from system tools
    • Any kind of MacOS update that changes library versions will never affect an app installed by MacPorts
    • requires sudo for any action that affects all users (most)
  • Sets up under /opt (need to add to $PATH)

Why use iTerm?

  • More Colors?
  • TODO: More notes here

Notes

  • Sort of based on https://github.com/whatyouhide/dotfiles
  • Started on init.sh script
  • Created specific zsh env files
  • Split aliases and functions into separate files
    • created one that is dependent on osx (osx.zsh)
  • Started on interactive prompt for remind (r!) script
    • script that reminds us of commands to use
    • renamed help file to remind with r! script
  • ssh autocomplete
    • need to add config in ~/.ssh/config
    • Need to investigate more
      • Can we autocomplete anything in ~/.ssh/known_hosts?
      • How does config work? user is automatically used? but how do I reference?
  • Started on doctor.zsh script
    • add symbolic link in scripts directory to doctor.zsh so we have access in the path
  • renamed init to setup.sh for once repo downloaded
  • installed vscode command line exec, open with: code <file_path>
  • .zshenv is executed on every new shell instance
    • linked to my zshenv.sym file in this directory

What is on the Default $PATH?

  • /Users/devlinjunker/.nvm/versions/node/v14.14.0/bin (from Macports I think)
  • /usr/local/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
  • /Library/Apple/usr/bin
  • /Users/devlinjunker/Code/shell/zsh/../scripts (Add Custom Scripts from shell/scripts)
  • /opt/local/bin (Added for MacPorts?)

Oh My ZSH

  • Themes, Plugins, Framework for Configuring ZSH Shell
  • Comes with Default .zshrc file
    • Sets theme + other configurations
    • Plus other customer lines to import my things
      • Currently:
        • Points at custom zshrc.sym file in this directory
    • Defines which plugins should be loaded
      • Currently:
        • git
  • set up custom theme bira+gitstatus
    • copied bira from ~/.oh-my-zsh/themes/ to themes/ directory repo
      • This is a ruby based theme.. may want to move away from this
    • symbolic link in ~/.oh-my-zsh/themes/ to the directory in themes/
    • set theme name in .zshrc
    • use personal gitstatus script in prompt
    • shows user, host and current directory + git status if in directory

iTerm