diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-05-27 14:19:09 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-05-27 14:19:09 +0200 |
commit | f0dd78002892ace7c61521c6ceeb6660d391ca70 (patch) | |
tree | db17be4927e4359cd1a5760a76c11c6182429a78 /config/essentials | |
parent | f32fc8b9eb8303d1ca2e1cc17773bc44d38fff3d (diff) | |
parent | f073720476b2bc19346049e4f2c774469289410f (diff) |
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'config/essentials')
-rw-r--r-- | config/essentials/git/config | 4 | ||||
-rw-r--r-- | config/essentials/shell/aliases.sh | 9 | ||||
-rw-r--r-- | config/essentials/shell/functions.sh | 21 | ||||
-rw-r--r-- | config/essentials/starship.toml | 12 | ||||
-rw-r--r-- | config/essentials/zsh/.gitignore | 3 | ||||
-rw-r--r-- | config/essentials/zsh/.zshrc | 2 |
6 files changed, 42 insertions, 9 deletions
diff --git a/config/essentials/git/config b/config/essentials/git/config index fcf80db..cb16983 100644 --- a/config/essentials/git/config +++ b/config/essentials/git/config @@ -10,3 +10,7 @@ rebase = false [commit] gpgsign = true +[merge] + ff = false +[alias] + change-commits = "!f() { VAR1=$1; VAR='$'$1; OLD=$2; NEW=$3; echo \"Are you sure for replace $VAR $OLD => $NEW ?(Y/N)\";read OK;if [ \"$OK\" = 'Y' ] ; then shift 3; git filter-branch --env-filter \"if [ \\\"${VAR}\\\" = '$OLD' ]; then export $VAR1='$NEW';echo 'to $NEW'; fi\" $@; fi;}; f " diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index ab17645..44aa7bc 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -170,7 +170,14 @@ alias wgdown='doas wg-quick down wg0' alias npi="npm init --yes" # Python -alias penv='python3 -m venv env' + +if which uv > /dev/null 2>&1 +then + alias penv='uv venv env' + alias pip='uv pip' +else + alias penv='python3 -m venv env' +fi alias phttp='python3 -m http.server' alias pipreq='pip install -r requirements.txt' diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index e0b148c..3676f26 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -336,3 +336,24 @@ fchange() eval "$1" done } + +unhappy.exe() { + [ "$1" ] && + smiles=("[: " ".-." " :]" "._.") || + smiles=("]: " ".-." " :[" "._.") + + while true + do + for s in $smiles + do + printf '\r%s' "$s" + sleep 1 + done + done +} + +ssh_port() +{ + ssh -f -N -L 0.0.0.0:"$3":localhost:"$1" "$2" + >&2 printf "Forwarded port '%s' on '%s' to '%s'.\n" "$1" "$2" "$3" +} diff --git a/config/essentials/starship.toml b/config/essentials/starship.toml index 15139f5..efcaf48 100644 --- a/config/essentials/starship.toml +++ b/config/essentials/starship.toml @@ -3,7 +3,7 @@ # Inserts a blank line between shell prompts add_newline = false # format = ' ${custom.upds}' -format = ' [\[$username@$hostname\]](bg:#000000) ${custom.upds}$all' +format = ' [\[$username@$hostname\]](bg:#000000) $all' right_format = """$status""" [character] @@ -32,8 +32,8 @@ min_time = 500 format = '($status)' disabled = false -[custom.upds] -command = 'cat ~/.cache/updates' # shows output of command -when = '[ "$(cat ~/.cache/updates)" -gt 0 ]' -symbol = '📦' -format = '$output$symbol ' +# [custom.upds] +# command = 'cat ~/.cache/updates' # shows output of command +# when = '[ "$(cat ~/.cache/updates)" -gt 0 ]' +# symbol = '📦' +# format = '$output$symbol ' diff --git a/config/essentials/zsh/.gitignore b/config/essentials/zsh/.gitignore index b717a37..a13c79f 100644 --- a/config/essentials/zsh/.gitignore +++ b/config/essentials/zsh/.gitignore @@ -1,2 +1,3 @@ histfile -zcompcache
\ No newline at end of file +zcompcache +.zcompdump diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index e2704e9..6e28602 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -115,7 +115,7 @@ add-zsh-hook -Uz preexec () { print -n "\e]0;$1\a\033[0m"; } add-zsh-hook -Uz precmd set_wt (){ print -Pn "\e]0;%n@%m on %~\a"; } ## automatic ls after cd -add-zsh-hook -Uz chpwd (){ [ "$PWD" = "$HOME" ] || ls -a; } +add-zsh-hook -Uz chpwd (){ [ "$PWD" = "$HOME" ] || ls -A; } ### Variables ## Run menuscripts with fzf |