Skip to content

kmasalski/Dev-Configurations-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set up a productive Windows development environment

This repository is designed to streamline the configuration process and provide easy installation instructions for creating an opinionated development environment on your Windows machine.

You'll also find example backup configuration files and a list of mundane tasks for setting up a new development environment.

Automated installation of essential applications with winget

Use winget (Microsoft's package manager) to streamline the installation of essential applications for Windows. The winget import command allows you to automate the installation process of multiple applications by providing a predefined list in a JSON file. The repository provides a predefined list of popular applications in winget.json to make the setup process easier.

  1. Install winget from the Microsoft Store

  2. Install applications using winget import.

    winget import winget.json

Customize Windows Terminal and shell for development productivity

image

  1. Install nerd fonts

    iwr -useb get.scoop.sh | iex;
    scoop bucket add nerd-fonts;
    scoop install Hack-NF;
  2. Install shell customization tools

    As administrator run the following:

    Install-Module -Name z;
    Install-Module -Name Terminal-Icons -Repository PSGallery;
    scoop install lsd
    Install-Module PSReadLine;
    Install-Module posh-git;
  3. Update your PowerShell profile to Microsoft.PowerShell_profile.ps1

    code $PROFILE

    Microsoft.PowerShell_profile.ps1 configures and customizes the behavior of the PSReadLine module in Windows Terminal for PowerShell. It also defines several functions and aliases for various tasks and utilities.

  4. Set display font to Hack Nerd Font in:

    1. Visual Studio Code https://ohmyposh.dev/docs/installation/fonts
    2. Windows Terminal https://ohmyposh.dev/docs/installation/fonts
    3. JetBrains IDE: File -> Settings -> Editor -> Colors & Fonts -> Console Font.

Block distracting websites

You can redirect time-wasting sites to a non-existent or restricted IP address. This technique helps enhance productivity by reducing the temptation to visit time-wasting or distracting online platforms.

  1. Open hosts file

    code C:\Windows\System32\drivers\etc\hosts
  2. Then update the contents to the attached example

Docker on Windows Subsystem for Linux (WSL)

  1. Install WSL (run as administrator)

    wsl --install
  2. To improve performance, adjust the amount of memory and processors used by updating the .wslconfig file.

     code $env:userprofile/.wslconfig
  3. Install docker and docker compose at wsl

Git config

  1. Automatically stash and pop pending changes when using "git pull"

    Simplifies workflow when pulling changes

    git config --global pull.rebase true;
    git config --global rebase.autoStash true;
  2. Automatically set upstream when using "git push"

    Simplifies workflow when pushing a branch for the first time

    git config --global push.default current
  3. Set default git editor

    Use the following command to set up Visual Studio Code or your preferred text editor as the default Git editor. Ensure it is installed and available in your system's PATH.

    git config --global core.editor "code"
  4. Set username and email

    git config --global user.email "";
    git config --global user.name "";
  5. Globally ignore files

    Enable global .gitignore file

    git config --global core.excludesfile ~/.gitignore

    Then create the .gitignore file.

    code $env:userprofile/.gitignore

    The contents may vary by your IDEs and tools used. GitHub's collection of templates to use globally. Below is an example configuration.

    .idea/
    .code/
  6. Autocorrect spelling mistakes

    git config --global help.autocorrect 30

Git hooks

This repository contains Git hooks that automate tasks during different stages of development. To use the Git hooks:

  • in your project environment, copy the files from hooks to the .git/hooks/ directory in your project
  • in all your projects, run the following command in terminal:
    git config --global core.hooksPath ~/.githooks
    and then copy from hooks to the ~/.githooks directory.

Pre-commit git hook

The pre-commit git hook helps automate repetitive tasks before each commit in .net projects. The hook performs the following actions:

  1. Runs dotnet build to ensure that the code compiles.
  2. Executes dotnet test to ensure that tests pass.
  3. Formats changed .cs files using dotnet format.

Post-merge git hook

The post-merge git hook updates npm dependencies by running npm install after git pull when it detects any change in any package-lock.json in a repository.

Prepare-commit-msg git hook

The prepare-commit-msg hook is invoked before the commit message is finalized. In this repository, the prepare-commit-msg hook automatically adds the issue tracker number to the beginning of the commit message if the branch name contains numbers.