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.
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.
-
Install
winget
from the Microsoft Store -
Install applications using
winget import
.winget import winget.json
-
iwr -useb get.scoop.sh | iex; scoop bucket add nerd-fonts; scoop install Hack-NF;
-
Install shell customization tools
- z - quickly navigate the file system
- TerminalIcons or lsd - upgrade the ls view
- JanDeDobbeleer.OhMyPosh - themes for shell
- PSReadLine - upgrades the command line with features like shortcuts or syntax highlighting
- posh-git - git status and git commands tab completion
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;
-
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.
-
Set display font to
Hack Nerd Font
in:- Visual Studio Code https://ohmyposh.dev/docs/installation/fonts
- Windows Terminal https://ohmyposh.dev/docs/installation/fonts
- JetBrains IDE: File -> Settings -> Editor -> Colors & Fonts -> Console Font.
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.
-
Open
hosts
filecode C:\Windows\System32\drivers\etc\hosts
-
Then update the contents to the attached example
-
Install WSL (run as administrator)
wsl --install
-
To improve performance, adjust the amount of memory and processors used by updating the
.wslconfig
file.code $env:userprofile/.wslconfig
-
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;
-
Automatically set upstream when using "git push"
Simplifies workflow when pushing a branch for the first time
git config --global push.default current
-
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"
-
Set username and email
git config --global user.email ""; git config --global user.name "";
-
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/
-
Autocorrect spelling mistakes
git config --global help.autocorrect 30
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:
and then copy from hooks to the
git config --global core.hooksPath ~/.githooks
~/.githooks
directory.
The pre-commit git hook helps automate repetitive tasks before each commit in .net projects. The hook performs the following actions:
- Runs
dotnet build
to ensure that the code compiles. - Executes
dotnet test
to ensure that tests pass. - Formats changed
.cs
files usingdotnet format
.
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.
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.