Skip to content

A collection of scripts, config, etc. that I use to make my life as a software engineer easier.

License

Notifications You must be signed in to change notification settings

melmaliacone/mels-dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mel's Developer Environment Configuration

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

zsh configuration

My ~/.zshrc file

Brewfile

Brewfile contains all my Homebrew formulae

To generate your own Brewfile to save your homebrew configuration

brew bundle dump

To install my formulae

brew bundle

git-repo-sync.sh

Automatically sync your local git repos with their upstream default branch

Works by aliasing the builtin cd command to my git_cd function, which runs a bunch of git commands under the hood.

The function handles fetching, pulling, and then gracefully returning you to your originally checked out branch and state.

Check out the full script here.

It lives directly in my .zshrc file.

.mel-zsh-functions/

Includes functions I run automatically when I start a new terminal

Creating your own 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

Enable autocomplete in zsh.

Prequisites

  • python installed

  • Run these commands

    brew install bash-completion
    pip install argcomplete
    activate-global-python-argcomplete

Partially taken from stack overflow.

homebrew_sync

Prequisites

Update Homebrew, upgrade your formulae, and then run brew doctor and brew cleanup.

Sets HOMEBREW_GITHUB_API_TOKEN to prevent homebrew use limits.

About

A collection of scripts, config, etc. that I use to make my life as a software engineer easier.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published