Skip to content

Instantly share code, notes, and snippets.

View Magnuti's full-sized avatar

Magnuti

  • Trondheim, Norway
View GitHub Profile
@Magnuti
Magnuti / .zshrc
Created March 7, 2024 14:34
Useful .zshrc stuff
# Command for terminating process on a port number
# $ kill_on_port <port_number>
function kill_on_port() {
if [ $# -eq 0 ]
then
echo "Please provide a port number"
return
fi
if [ -z "$1" ]
@Magnuti
Magnuti / zshrc.md
Last active February 2, 2024 08:29
.zshrc profile for Git autocompletion and branch name

Git autocompletion and Git branch name in Z shell prompt

autoload -Uz compinit && compinit

function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}

COLOR_GIT=$'%F{39}'
@Magnuti
Magnuti / posh_git_installation.md
Last active January 18, 2022 20:33
PoshGit installation
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
Add-PoshGitToProfile -AllHosts
@Magnuti
Magnuti / .gitconfig
Last active December 20, 2023 15:35
Global .gitconfig file
[alias]
st = status
[push]
autosetupremote = true
# Fixes contrasts issues on Powershell terminals with blue background
[color "status"]
changed = red bold
untracked = red bold
added = green bold