{
    "componentChunkName": "component---src-templates-post-js",
    "path": "/zsh-setup",
    "result": {"data":{"site":{"siteMetadata":{"title":"your friend Joel's digital garden","description":"Articles and notes from a collaborator at egghead.io. Musings on software, business, and life from a skilled virtual assistant.","author":{"name":"Joel Hooks"},"keywords":["Video Blogger"]}},"mdx":{"excerpt":"These are notes about my personal setup for a new macOS computer. Some of the\ninstructions might be incorrect for your environment Getting Started You'll need several things installed on your machine to proceed with configuring\nzsh beyond…","fields":{"github":"https://github.com/joelhooks/joelhooks-com/tree/master/content/blog/zsh-setup/index.mdx"},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"id\": \"TEezefuLg\",\n  \"slug\": \"zsh-setup\",\n  \"date\": \"2021-11-28T00:00:00.000Z\",\n  \"title\": \"Basic zsh Developer Shell Setup for a New M1 Mac\",\n  \"published\": false\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"These are notes about my personal setup for a new macOS computer. Some of the\\ninstructions might be incorrect for your environment\"), mdx(\"h2\", null, \"Getting Started\"), mdx(\"p\", null, \"You'll need several things installed on your machine to proceed with configuring\\nzsh beyond the defaults.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Xcode Command Line Tools: just run \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"xcode-select --install\"), \". This is an SDK\\nand tool for development in the command line environment. Lots of things\\ndepend on it and it's essential.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"homebrew: \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://brew.sh/\"\n  }, \"https://brew.sh/\"), \" is the community standard package manager for macOS\\nand des a lot of work installing and managing libraries and tools within your\\nshell environment.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"git: \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://git-scm.com/download/mac\"\n  }, \"https://git-scm.com/download/mac\"), \" you want the latest version of git\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"zsh: short for Z shell, is the default login and interactice shell for\\nmacOS \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://support.apple.com/en-us/HT208050\"\n  }, \"as of 2019 with the relase of Catalina\"), \"\\n. We're gonna set it up nice.\")), mdx(\"p\", null, \"Take care of Xcode and homebrew, then we'll configure git and zsh (with\\noh-my-zsh)\"), mdx(\"p\", null, \"Let's get started!\"), mdx(\"h2\", null, \"Set up git\"), mdx(\"p\", null, \"Setup your credentials:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"git config --global user.name \\\"Firstname Lastname\\\"\\ngit config --global user.email \\\"username@myEmail.com\\\"\\n\")), mdx(\"p\", null, \"When you run these commands a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".gitconfig\"), \" is set up in your home folder \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"cd ~\"), \".\"), mdx(\"p\", null, \"Mine looks like this and I store\\nit \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://gist.github.com/joelhooks/cce364199d2532c0d8bb8a93cdc7c685\"\n  }, \"in a gist\"), \"\\nfor future reference:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"[user]\\n    email = joelhooks@gmail.com\\n    name = Joel Hooks\\n[core]\\n    excludesfile = /Users/joel/.gitignore\\n    editor = code\\n[init]\\n    defaultBranch = main\\n[pull]\\n    rebase = false\\n[alias]\\n    co = checkout\\n\")), mdx(\"p\", null, \"You'll notice a few options are set. The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"excludesFile\"), \" option lets me have a\\nglobal \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".gitignore\"), \" which looks like this:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \".DS_Store\\n.idea\\n\")), mdx(\"p\", null, \"Now these pesky local files will never get added to my repositories.\"), mdx(\"p\", null, \"I've set my preferred editor, how I prefer to handle pull requests,\\na \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"defaultBranch\"), \" name, and a single alias. Aliases are actually super handy and\\ncan be very powerful so I\\nrecommend \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases\"\n  }, \"reading further\"), \"\\n.\"), mdx(\"p\", null, \"All of the settings in \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".gitconfig\"), \" can be set using \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"git config --global [...]\"), \"\\n, but editing the text file makes it quicker to set many all at once.\"), mdx(\"h2\", null, \"zsh\"), mdx(\"p\", null, \"By default zsh is very capable and provides many improvements over bash (the\\nprevious macOS default). Notably it provides a comprhensive command-line\\ncompletion system that can save a lot of time when you're working in the\\nterminal.\"), mdx(\"p\", null, \"Beyond the basics, there are several things that I like to add to my default zsh\\nconfiguration immediately.\"), mdx(\"h3\", null, \"oh-my-zsh\"), mdx(\"p\", null, \"oh-my-zsh is an open-source configuration framework and manager for zsh.\\noh-my-zsh gives you access to a trove of useful plugins and is essential if\\nyou're running zsh as your shell.\"), mdx(\"p\", null, \"Installation instructions can be found here: \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://ohmyz.sh/\"\n  }, \"https://ohmyz.sh/\")), mdx(\"p\", null, \"Once zsh is installed, it needs some configuration. We are going to add a few\\nplugins.\"), mdx(\"p\", null, \"Open the config file:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"open .zshrc\\n\")), mdx(\"p\", null, \"Among other things, oh-my-zsh gives you the ability to apply themes. They have\\nmany to choose from. I use the default theme personally, but you can explore.\\nThe configuration file is well documented. The major changes for me are adding\\nplugins and some path work for my development environment.\"), mdx(\"h3\", null, \"pure prompt\"), mdx(\"p\", null, \"The default prompt for zsh is hideous in my opinion and needs to be instantly\\nchanged. I use the Pure prompt because it's simple, compact, and provides useful\\ninformation for my development workflow.\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/sindresorhus/pure\"\n  }, \"https://github.com/sindresorhus/pure\")), mdx(\"p\", null, \"I don't do a lot of custom configuration of pure prompt in general, but I did\\nneed to add the following to the bottom of my \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"~.zshrc\"), \" configuration to git it\\nto run after installation as instructed by the documentation:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"autoload -U promptinit; promptinit\\nprompt pure\\n\")), mdx(\"p\", null, \"I also ran into path issue and had to manually install pure and direct zsh to\\nthe manually installed location. Hopefully you can avoid this on your machine.\"), mdx(\"p\", null, \"Pure looks good by itself, but I also like to colorize my terminal and add a\\nnicer font. Color schemes and fonts tend to be personal choices, but I like\\nTomorrow Night Eighties for color\\nand \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://philpl.gumroad.com/l/dank-mono\"\n  }, \"Dank Mono\"), \" for the font.\"), mdx(\"p\", null, \"File>Save\\nas \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://raw.githubusercontent.com/chriskempson/tomorrow-theme/master/OS%20X%20Terminal/Tomorrow%20Night%20Eighties.terminal\"\n  }, \"this file\"), \"\\nand open it to add the Tomorrow Night *0s color scheme to Terminal. In the\\nTerminal app preferences you might need to set it as the default theme for\\nTerminal. You can also change the font here and set a larger text size.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1035px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/b5fa60b44c2a285a177d9eb277a8d33d/be0f2/terminal_prefs.jpg\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"91.11969111969113%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAASABQDASIAAhEBAxEB/8QAGAABAQADAAAAAAAAAAAAAAAAAAIBAwX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAHlKGtgVIAf/8QAFhABAQEAAAAAAAAAAAAAAAAAARAR/9oACAEBAAEFAkypVv8A/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAwEBPwEf/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAgEBPwEf/8QAFhAAAwAAAAAAAAAAAAAAAAAAARAg/9oACAEBAAY/AmK//8QAGxAAAgIDAQAAAAAAAAAAAAAAAREAMRAhcWH/2gAIAQEAAT8hYHssw3CPgQpne+YIrOf/2gAMAwEAAgADAAAAEKDIvP/EABQRAQAAAAAAAAAAAAAAAAAAACD/2gAIAQMBAT8QH//EABQRAQAAAAAAAAAAAAAAAAAAACD/2gAIAQIBAT8QH//EABsQAQADAQADAAAAAAAAAAAAAAEAETEhUdHx/9oACAEBAAE/EKS2IHR2cU9ThHZd200qVsMpn3HZRnLxctdZfCf/2Q==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"terminal preferences\",\n    \"title\": \"terminal preferences\",\n    \"src\": \"/static/b5fa60b44c2a285a177d9eb277a8d33d/af659/terminal_prefs.jpg\",\n    \"srcSet\": [\"/static/b5fa60b44c2a285a177d9eb277a8d33d/8356d/terminal_prefs.jpg 259w\", \"/static/b5fa60b44c2a285a177d9eb277a8d33d/bc760/terminal_prefs.jpg 518w\", \"/static/b5fa60b44c2a285a177d9eb277a8d33d/af659/terminal_prefs.jpg 1035w\", \"/static/b5fa60b44c2a285a177d9eb277a8d33d/be0f2/terminal_prefs.jpg 1328w\"],\n    \"sizes\": \"(max-width: 1035px) 100vw, 1035px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"h3\", null, \"zsh-syntax-highlight\"), mdx(\"p\", null, \"This is a great plugin that gives some colorized feedback to your shell\\ncommands. Here are\\nthe \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh\"\n  }, \"oh-my-zsh setup instructions\")), mdx(\"p\", null, \"My final plugin setup looks like this:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"plugins=(git rails ruby history emoji encode64 jsontools macos zsh-syntax-highlighting)\\n\")), mdx(\"p\", null, \"You can look up the other plugins and all of the available plugins (there is a\\nshitload) that might suit your personal needs. Here's my final \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".zshrc\"), \" for my\\nenvironment (it's probably not cut and paste compatible for your machine)\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"export PATH=$HOME/bin:/usr/local/bin:$PATH\\nexport ZSH=$HOME/.oh-my-zsh\\nZSH_THEME=\\\"robbyrussell\\\"\\n\\nplugins=(git rails ruby history emoji encode64 jsontools macos zsh-syntax-highlighting)\\n\\nsource $ZSH/oh-my-zsh.sh\\n\\n# Pure prompt plugin loader\\nfpath+=$HOME/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure\\n\\n\")), mdx(\"h2\", null, \"What's Next?\"), mdx(\"p\", null, \"The reveal is anti-climactic BUT at this point you've got a powerful shell\\nenvironment that looks nice and will grow with you as you personalize it for\\nyour own needs.\"), mdx(\"p\", null, \"Here's how it looks:\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1035px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/f87e4f876771849e93511dad145d3ef7/eb1d2/terminal_shot.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"69.11196911196912%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAy0lEQVQ4y71T7Q6CMAz0dYDOrSiwL5REYyS+//OcgUQkY4CExB+XZmt3vWu6w+WuobWBripYY2AqDas1jKtxfbxwaxq0zxa18zifTmCpwGoKJSW8cziwzJHnOZh5iNxFpSCPAqo7MyNNU2RZBiKKosu5jrCsSiRJMlz2BZGHQohFDIRrhVNQEAPCb3daQEg0zY8U0kx3mlEUqxkT/qSQNiikUCFtVLhqeadCoj0zjK7NX2e4jdBaG1peWuC41bFl7/3H8l6I/nsWRYE3YP6usS548WwAAAAASUVORK5CYII=')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"final terminal\",\n    \"title\": \"final terminal\",\n    \"src\": \"/static/f87e4f876771849e93511dad145d3ef7/e3189/terminal_shot.png\",\n    \"srcSet\": [\"/static/f87e4f876771849e93511dad145d3ef7/a2ead/terminal_shot.png 259w\", \"/static/f87e4f876771849e93511dad145d3ef7/6b9fd/terminal_shot.png 518w\", \"/static/f87e4f876771849e93511dad145d3ef7/e3189/terminal_shot.png 1035w\", \"/static/f87e4f876771849e93511dad145d3ef7/44d59/terminal_shot.png 1553w\", \"/static/f87e4f876771849e93511dad145d3ef7/eb1d2/terminal_shot.png 1622w\"],\n    \"sizes\": \"(max-width: 1035px) 100vw, 1035px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")));\n}\n;\nMDXContent.isMDXComponent = true;","frontmatter":{"title":"Basic zsh Developer Shell Setup for a New M1 Mac","date":"November 28, 2021","banner":null,"slug":"zsh-setup","keywords":null}}},"pageContext":{"id":"89685b70-d369-5763-baec-c1d8f9b5f248","prev":{"id":"11a06fb9-c10b-5cef-b8ad-46c643437215","parent":{"name":"index","sourceInstanceName":"blog"},"excerpt":"After  15 years on Twitter  recent events have me strongly considering other venues for my positive and optimistic updates to like-minded folks. Mastodon has seen a strong boost in utility recently as a solid replacement to Twitter. I'm giving it a…","fields":{"title":"Mastodon as a Replacement for Twitter","slug":"mastodon-as-a-replacement-for-twitter","date":"2022-11-18T00:00:00.000Z"}},"next":{"id":"ca686418-fb04-523c-92f9-e173aa570b47","parent":{"name":"index","sourceInstanceName":"blog"},"excerpt":"There are a lot of interesting options for commercial and open source players. In the last several years  HTMLVideoElement  has become cross platform standard and simplified media player development considerably. No Flash fallback required! Despite…","fields":{"title":"React Video Player Component Using Hooks, TypeScript, and xState","slug":"react-video-player","date":"2021-09-10T00:00:00.000Z"}}}},
    "staticQueryHashes": ["1045846374"]}