Minor fix

This commit is contained in:
js0ny 2025-03-20 20:14:01 +00:00
parent 9f85a746dc
commit 17cf51c1ca
5 changed files with 128 additions and 8 deletions

View file

@ -0,0 +1,34 @@
{
"ul-style": { // MD004
"style": "dash" // -
},
"ul-indent": { // MD007
"indent": 4
},
"no-hard-tabs": {
"ignore_code_languages": [
"go"
]
},
"line-length": false, // MD013
"no-missing-space-atx": false, // MD018, prevent from formatting `#tag` to `# tag`
"no-inline-html": { // MD033
"allowed_elements": [
"kbd", // keyboard key
"u", // underline
"sup", // superscript
"sub", // subscript
"center", // center text
"cursor", // Personal use
"font", // Font family
"iframe" // Embed Web content
]
},
// "fenced-code-language": { // MD040
// },
"first-line-h1": false, // MD041
"code-block-style": false // MD046: This will parse LaTeX indentation as indented code block
// "code-block-style": {
// "style": "fenced" // MD046
// }
}

View file

@ -3,7 +3,81 @@
# Author: js0ny
# Use starship to set prompt
Invoke-Expression (&starship init powershell)
# Invoke-Expression (&starship init powershell)
function formatFG {
param(
[string]$RGB
)
if ($RGB -eq "-1") {
return "`e[39m"
}
$R = $RGB.Substring(0, 2)
$G = $RGB.Substring(2, 2)
$B = $RGB.Substring(4, 2)
# Convert hex to RGB
$R = [int]::Parse($R, [System.Globalization.NumberStyles]::HexNumber)
$G = [int]::Parse($G, [System.Globalization.NumberStyles]::HexNumber)
$B = [int]::Parse($B, [System.Globalization.NumberStyles]::HexNumber)
return "`e[38;2;$R;$G;${B}m"
}
function formatBG {
param(
[string]$RGB
)
if ($RGB -eq "-1") {
return "`e[49m"
}
$R = $RGB.Substring(0, 2)
$G = $RGB.Substring(2, 2)
$B = $RGB.Substring(4, 2)
# Convert hex to RGB
$R = [int]::Parse($R, [System.Globalization.NumberStyles]::HexNumber)
$G = [int]::Parse($G, [System.Globalization.NumberStyles]::HexNumber)
$B = [int]::Parse($B, [System.Globalization.NumberStyles]::HexNumber)
return "`e[48;2;$R;$G;${B}m"
}
function formatPowerlineText {
param(
[string]$FG,
[string]$BG,
[string]$PLBG,
[string]$Text
)
$ResumeSequece = "`e[0m"
$TextFG = formatFG -RGB $FG
$TextBG = formatBG -RGB $BG
$PLFG = formatFG -RGB $BG
$PLBG = formatBG -RGB $PLBG
return "$TextFG$TextBG $Text $PLFG$PLBG$ResumeSequece"
}
function prompt {
if ($pwd.Path -eq $HOME) {
$cwd = "~"
} else {
$cwd = $pwd.ProviderPath
}
$time = Get-Date -Format "HH:mm"
$ResumeSequece = "`e[0m"
$FG0 = "FFFFFF"
$BG0 = "9A348E"
$BG1 = "DA627D"
$BG2 = "FCA17D"
$FG1 = "035E82"
$time = formatPowerlineText $FG0 $BG0 $BG1 $time
$cwd = formatPowerlineText $FG0 $BG1 $BG2 $cwd
$ps = formatPowerlineText $FG1 $BG2 "-1" "PS"
"$time$cwd$ps$ResumeSequece "
}
function Invoke-Starship {
Invoke-Expression (&starship init powershell)
}
Import-Module Catppuccin