Compare commits
4 Commits
11ac914eea
...
ad07f55ac6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad07f55ac6 | ||
|
|
a8e462e129 | ||
|
|
16977202b9 | ||
|
|
3881086797 |
@ -3,6 +3,7 @@
|
|||||||
{{- $category := promptString "Server category" -}}
|
{{- $category := promptString "Server category" -}}
|
||||||
{{- $color := promptString "Prompt color (see https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes)" -}}
|
{{- $color := promptString "Prompt color (see https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes)" -}}
|
||||||
{{- $vimexec := promptString "Which vi executable to use? (vi, vim, nvim)" -}}
|
{{- $vimexec := promptString "Which vi executable to use? (vi, vim, nvim)" -}}
|
||||||
|
{{- $promptType := promptString "Which prompt to use? (starship, oh-my-posh, none)" -}}
|
||||||
[data]
|
[data]
|
||||||
name = "{{ $name }}"
|
name = "{{ $name }}"
|
||||||
email = "{{ $email }}"
|
email = "{{ $email }}"
|
||||||
@ -10,3 +11,4 @@
|
|||||||
|
|
||||||
bash.prompt.category = "{{ $category }}"
|
bash.prompt.category = "{{ $category }}"
|
||||||
bash.prompt.color = "{{ $color }}"
|
bash.prompt.color = "{{ $color }}"
|
||||||
|
bash.prompt.type = "{{ $promptType }}"
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
{{ if eq .bash.prompt.type "oh-my-posh" }}
|
||||||
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\atomic.omp.json" | Invoke-Expression
|
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\atomic.omp.json" | Invoke-Expression
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
function Get-LastN {
|
function Get-LastN {
|
||||||
param (
|
param (
|
||||||
@ -21,6 +23,20 @@ function Net-Cat() {
|
|||||||
Test-NetConnection -ComputerName $computerName -Port $port -InformationLevel Detailed
|
Test-NetConnection -ComputerName $computerName -Port $port -InformationLevel Detailed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# History with search
|
||||||
|
function hist {
|
||||||
|
$find = $args
|
||||||
|
Write-Host "Finding in full history using {`$_ -like `"*$find*`"}"
|
||||||
|
Get-Content (Get-PSReadlineOption).HistorySavePath | ? {$_ -like "*$find*"} | Get-Unique | more
|
||||||
|
}
|
||||||
|
# Reverse History Search
|
||||||
|
# Found at https://stackoverflow.com/questions/62883762/powershell-bind-arrow-keys-to-command-history-search
|
||||||
|
#
|
||||||
|
# Set-PSReadlineKeyHandler will list all mapped keys
|
||||||
|
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
|
||||||
|
Set-PSReadlineKeyHandler -Key PageUp -Function HistorySearchBackward
|
||||||
|
Set-PSReadlineKeyHandler -Key PageDown -Function HistorySearchForward
|
||||||
|
|
||||||
# Navigate one directory up
|
# Navigate one directory up
|
||||||
function Go-One-Level-Up {
|
function Go-One-Level-Up {
|
||||||
cd ..
|
cd ..
|
||||||
@ -38,3 +54,12 @@ Set-Alias ... Go-Two-Levels-Up
|
|||||||
# More Aliases
|
# More Aliases
|
||||||
Set-Alias vi nvim
|
Set-Alias vi nvim
|
||||||
Set-Alias vim nvim
|
Set-Alias vim nvim
|
||||||
|
Set-Alias ll dir
|
||||||
|
|
||||||
|
function gg {
|
||||||
|
git graph
|
||||||
|
}
|
||||||
|
|
||||||
|
{{ if eq .bash.prompt.type "starship" }}
|
||||||
|
Invoke-Expression (&starship init powershell)
|
||||||
|
{{ end }}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ function backup
|
|||||||
|
|
||||||
function forget
|
function forget
|
||||||
{
|
{
|
||||||
restic --keep-daily 2 --keep-weekly 2 --keep-monthly 5
|
restic forget --keep-daily 2 --keep-weekly 2 --keep-monthly 5
|
||||||
}
|
}
|
||||||
|
|
||||||
function list()
|
function list()
|
||||||
@ -30,4 +30,5 @@ switch($action) {
|
|||||||
"list" { list }
|
"list" { list }
|
||||||
"snapshots" { restic snapshots }
|
"snapshots" { restic snapshots }
|
||||||
"stats" { restic stats }
|
"stats" { restic stats }
|
||||||
|
default { Write-Host "xxx" }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $kubernetes\
|
|||||||
[](fg:#212736 bg:#1d2230)\
|
[](fg:#212736 bg:#1d2230)\
|
||||||
$time\
|
$time\
|
||||||
[ ](fg:#1d2230)\
|
[ ](fg:#1d2230)\
|
||||||
|
$battery \
|
||||||
\n$character"""
|
\n$character"""
|
||||||
|
|
||||||
[os]
|
[os]
|
||||||
@ -95,6 +96,25 @@ style = "fg:#769ff0 bg:#212736"
|
|||||||
format = '[[ $symbol $context \($namespace\)](fg:#769ff0 bg:#212736)]($style)'
|
format = '[[ $symbol $context \($namespace\)](fg:#769ff0 bg:#212736)]($style)'
|
||||||
disabled = false
|
disabled = false
|
||||||
|
|
||||||
|
[battery]
|
||||||
|
#full_symbol = '🔋 '
|
||||||
|
#charging_symbol = '⚡️ '
|
||||||
|
#discharging_symbol = '💀 '
|
||||||
|
#style = "bg:#1d2230"
|
||||||
|
#format = '[[$symbol$percentage](bg:#1d2230)]($style) '
|
||||||
|
|
||||||
|
[[battery.display]]
|
||||||
|
threshold = 30
|
||||||
|
style = 'bold red'
|
||||||
|
|
||||||
|
[[battery.display]]
|
||||||
|
threshold = 50
|
||||||
|
style = 'bold yellow'
|
||||||
|
|
||||||
|
[[battery.display]]
|
||||||
|
threshold = 80
|
||||||
|
style = 'bold green'
|
||||||
|
|
||||||
[custom.category]
|
[custom.category]
|
||||||
command = 'echo "[{{ .bash.prompt.category }}]"'
|
command = 'echo "[{{ .bash.prompt.category }}]"'
|
||||||
when = true
|
when = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user