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 # some default
export EDITOR="nvim" export EDITOR="nvim"
@@ -9,9 +11,10 @@ export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
#fzf # fzf
export FZF_DEFAULT_OPTS="--style default --layout=reverse --height 30% --preview='batcat --plain --color=always {}'" 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 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 MANPAGER="sh -c 'col -bx | batcat --language=man --plain'"
export MANROFFOPT="-c" export MANROFFOPT="-c"

View File

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