Giter Club home page Giter Club logo

mels-dev-env's Introduction

Mel's Dev Config

A collection of scripts, files, etc. that I've written myself or collected from stack overflow over the years.

I use them in my dev environment (at my full time job) to make my life easier.

zsh configuration

My ~/.zshrc file

Brewfile

My Brewfile contains all my Homebrew formulae

To install my formulae

brew bundle

To generate your own Brewfile to save your homebrew configuration

brew bundle dump

Creating your own custom functions

My .mel-zsh-functions directory for custom functions

The steps below walk through how to make custom functions available outside of aliasing them and how to run them automatically when you start a new terminal session.

Setup steps (mostly copied from a Stack Exchange post)

  1. My ~/.mel-zsh-functions directory contains my custom functions, with a file for each function.
    To get this working for yourself:

    • Your directory can be called anything and can be located anywhere on your computer
    • The function script file must be named the name of the function (with no file extension)
    • The file itself can contain any bash/zsh scripting and doesn't need to be wrapped in function <function_name> {} or contain #!/bin/bash
    • zsh is designed so that the name of the file is the function name
  2. Add or update the FPATH environment variable to include the directory with your functions.
    For example, I added the line below to my ~/.zshrc

    export FPATH=~/.mel-zsh-functions:$FPATH

    โš ๏ธ Do not put any quotes around the FPATH value. It will not work.

    At this point, you can call your function(s), assuming you've opened a new terminal window or sourced your ~/.zshrc. For example, if I want to run the function homebrew_sync, I just type homebrew_sync in my terminal window, hit enter, and it runs.

  3. For any functions you'd like to run automatically whenever a new terminal window is opened, you need to add a line to your ~/.zshrc

    autoload -U +X <your_function> && <your_function>

My custom functions

autocomplete

Script to enable autocomplete in zsh

gcp_sdk

Script to setup gcloud sdk via Homebrew

homebrew_sync

Script to update Homebrew, upgrade your formulae, and then run brew doctor and brew cleanup

I have this aliased in my ~/.zshrc and configured to run automatically when I open a new terminal window.

Automatically sync your git repos with origin/<default_branch>

git-repo-sync script

I have this in my ~/.zshrc.

It works by using the builtin cd command, running my functions after, and aliasing cd. Check out the script for more details and to see everything that it does.

mels-dev-env's People

Contributors

melmaliacone avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.