Commit b3aa5ace authored by Jørn Åne's avatar Jørn Åne Committed by Jørn Åne

Show fuller path in fish prompt.

parent 4a2593bc
function prompt_pwd_full
set -q fish_prompt_pwd_dir_length; or set -l fish_prompt_pwd_dir_length 1
if [ $fish_prompt_pwd_dir_length -eq 0 ]
set -l fish_prompt_pwd_dir_length 99999
end
set -l realhome ~
echo $PWD | sed -e "s|^$realhome|~|" -e 's-\([^/.]{'"$fish_prompt_pwd_dir_length"'}\)[^/]*/-\1/-g'
end
function fish_prompt -d "Write out the prompt"
printf '\n%s%s%s%s@%s:%s%s%s\n> ' (set_color normal) (set_color --bold) (whoami) (set_color normal) (hostname) (set_color --bold --background blue white) (prompt_pwd) (set_color normal)
printf '\n%s%s%s%s@%s:%s%s%s\n> ' (set_color normal) (set_color --bold) (whoami) (set_color normal) (hostname) (set_color --bold --background blue white) (prompt_pwd_full) (set_color normal)
end
export LC_ALL=C
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment