Fix length with user + clean zprofile

This commit is contained in:
François
2026-05-15 21:10:23 +02:00
parent 3803d38c1a
commit 575854e772
2 changed files with 7 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
#!/bin/sh
# some default
export EDITOR="nvim"
@@ -13,5 +15,6 @@ export XDG_CACHE_HOME="$HOME/.cache"
export FZF_DEFAULT_OPTS="--style default --layout=reverse --height 30% --preview='batcat --plain --color=always {}'"
export FZF_CTRL_R_OPTS="--style minimal --info inline --no-sort --no-preview" # separate opts for history widget
# man
export MANPAGER="sh -c 'col -bx | batcat --language=man --plain'"
export MANROFFOPT="-c"

View File

@@ -115,7 +115,7 @@ POWERLINE_STOP="\ue0b4"
POWERLINE_STOP_INV="\ue0b6"
PROMPT_ENTER="" #"\ueb70"
PROMPT_PAD="."
PROMPT_EXTRA_WIDTH=66
PROMPT_EXTRA_WIDTH=58
precmd() {
if [ -z ${STARTCMD_TS+x} ]; then
@@ -123,7 +123,8 @@ precmd() {
fi
local prompt_ln="${#${${PWD}/${HOME}/~}}" # len of path where $HOME is susbtiued by ~ (and is counted as 1)
local hn=$(hostname)
prompt_ln=$((prompt_ln + ${#hn}))
local u=$USER
prompt_ln=$((prompt_ln + ${#hn} + ${#u}))
if (($COLUMNS > PROMPT_EXTRA_WIDTH + prompt_ln)); then
local exec_ts=$(($(date +%s%N) - STARTCMD_TS))